id stringlengths 1 7 | text stringlengths 6 1.03M | dataset_id stringclasses 1
value |
|---|---|---|
1638953 | import os
import sys
import keras
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tensorflow as tf
from keras.callbacks import CSVLogger, History
from keras.layers import BatchNormalization, Dense, Dropout, Input
from keras.models import Model
# from .IntegratedGradient import integrated... | StarcoderdataPython |
3209562 | # -*- coding: utf-8 -*-
import simpy, scipy, numpy, random
from src.core.linear_congruential_generator import LinearCongruentialGenerator
RANDOM_SEED = 42
NUM_COMPONENTES_INDEPENDENTES = 2
QUANTIDADE_TESTES = 5
TEMPO_SIMULACAO = 7 * 24
def tef_uniform():
"""return a random value from uniform distribuition"""
... | StarcoderdataPython |
47041 | """Tests for RandoPony admin views and functionality.
"""
from datetime import datetime
import unittest
from unittest.mock import patch
from pyramid import testing
from pyramid_mailer import get_mailer
from sqlalchemy import create_engine
from randopony.models.meta import (
Base,
DBSession,
)
class TestCore... | StarcoderdataPython |
3349997 | #!usr/bin/env python
# Python Imports
import os
import time
from tkinter import Tk, Button, Label, filedialog
# Third party modules
import cv2
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image, ImageTk
from mtcnn.mtcnn import MTCNN
# Developer metadata.
__author__ = "<N... | StarcoderdataPython |
111273 | #!/usr/bin/python
import socket
import bluetooth, subprocess
nearby_devices = bluetooth.discover_devices(duration=4,lookup_names=True,
flush_cache=True, lookup_class=False)
TCP_IP = '44:44:1B:04:13:7D'
TCP_PORT = 13854
BUFFER_SIZE = 2048
name = 'Sichiray' #... | StarcoderdataPython |
146604 | <gh_stars>0
from launchable.testpath import FilePathNormalizer
import os.path
import pathlib
import subprocess
import sys
import tempfile
import unittest
class TestFilePathNormalizer(unittest.TestCase):
def test_relative_path(self):
n = FilePathNormalizer()
relpath = os.path.join('foo', 'bar', 'b... | StarcoderdataPython |
1748100 | <gh_stars>0
#!/usr/bin/python
#
# ICD model file helper: given a target directory tree, generate
# command-model.conf that sends all commands to assemblies in that
# tree, and subscribe-model.conf that subscribes to all events
# published by assemblies in that tree.
import os
import sys
import re
import fnmatch
from p... | StarcoderdataPython |
1629160 | <filename>samples/openapi3/client/petstore/python-legacy/test/test_format_test.py
# coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of ... | StarcoderdataPython |
3284676 | <filename>thonny/plugins/paren_matcher.py
import io
import token
from thonny import get_workbench
from thonny.codeview import CodeViewText
from thonny.shell import ShellText
import time
_OPENERS = {")": "(", "]": "[", "}": "{"}
TOKTYPES = {token.LPAR, token.RPAR, token.LBRACE, token.RBRACE, token.LSQB, token.RSQB}
... | StarcoderdataPython |
47946 | # Listing_23-11.py
# Copyright Warren & <NAME>, 2013
# Released under MIT license http://www.opensource.org/licenses/mit-license.php
# Version $version ----------------------------
# Crazy Eights - the main loop with scoring added
# Note that this is not a complete program. It needs to be put together
# ... | StarcoderdataPython |
3226121 | from constants.headers import ROUTING_PROVISIONING
from constants.nodetype import TYPE_PROVISIONING
from util.nodetype import NodeType
class Self:
# Singleton instance
_instance = None
node_id: bytes
node_type: NodeType
def __new__(cls):
if cls._instance is None:
cls._instance... | StarcoderdataPython |
1708827 | <gh_stars>1-10
import collections
import itertools
import math
import sys
import os
import cv2
import numpy
import tensorflow as tf
import common
import model
def letter_probs_to_code(letter_probs):
output = "".join(common.CHARS[i] for i in numpy.argmax(letter_probs, axis=1))
return output.replace("_", "")
... | StarcoderdataPython |
1688984 | import os
from platform import architecture, system
from subprocess import Popen
from sys import stderr
SENNA_DIR = 'senna/'
TMP_FILENAME = 'senna.tmp'
TMP_OUT_FILENAME = 'senna.out.tmp'
class SennaWrapper:
__senna_executable = None
__senna_location = None
def __init__(self):
self.__senna_loca... | StarcoderdataPython |
3376234 | <reponame>mathur/modelstruct<gh_stars>0
def ClassFactory(name, argnames, BaseClass=BaseClass):
def __init__(self, **kwargs):
for key, value in kwargs.items():
if key not in argnames:
raise TypeError("Argument %s not valid for %s"
% (key, self.__class__.__name_... | StarcoderdataPython |
1709509 | #Learning Python
"""This is a
multiline
Comment."""
import datetime
time = datetime.datetime.now()
print(time)
print("Hello, World!")
x = 5
y = 10
print(x)
print(y)
print(10*5)
name = "John"
a = "awesome"
print("Python is " + a)
print(x + y)
#If you try to combine a string and a number, Python will giv... | StarcoderdataPython |
68638 | # -*- coding: utf-8 -*-
# @Date : 2016-02-21 15:43:36
# @Author : <EMAIL>
import base64
import json
import urllib
from sgmllib import SGMLParser
from time import time
import tornado.gen
import tornado.web
from sqlalchemy.orm.exc import NoResultFound
from tornado.httpclient import HTTPRequest, AsyncHT... | StarcoderdataPython |
4827839 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 CamptoCamp. All rights reserved.
# @author <NAME>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Licen... | StarcoderdataPython |
3378901 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from buildbot.scheduler import Scheduler
from buildbot.scheduler import Triggerable
import collections
# This file contains useful functions for masters wh... | StarcoderdataPython |
1728840 | <reponame>jnngu/codingdatingsite<filename>styledating/main.py
from flask import Flask, render_template, request, redirect, url_for
from flask_login import LoginManager, UserMixin, login_required, login_user, logout_user, current_user
import sqlite3
import hashlib
import re
from util import *
from user import *
from aut... | StarcoderdataPython |
197656 | <reponame>GEOS-ESM/AeroApps<filename>src/Components/rtms/geo_vlidort/geo_vlidort_AI_lc2.py
#!/usr/bin/env python
# -W ignore::DeprecationWarning
"""
Runscript for running geo_vlidort.x on NCCS
May 2017
<EMAIL>
"""
from datetime import datetime, timedelta
from dateutil.parser import parse
import os... | StarcoderdataPython |
4812237 | <reponame>lachlants/denet
import sys
import time
import math
import denet.common.logging as logging
import denet.multi.network as network
from denet.multi.worker import WorkerProcess
#handles communication with update server
class UpdateClient():
def __init__(self, epoch_start, subset_start, subset_num, sock=Non... | StarcoderdataPython |
175616 | # -*- coding: utf-8 -*-
import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
"""
created by shhuan at 2017/10/20 14:23
"""
MAXN = 2000000+5
G = collections.defaultdict(list)
def addEdge(s, t):
G[s].append(t)
G[t].append(s)
N = 0
siz = [0] * MAXN... | StarcoderdataPython |
123832 | <reponame>kamadorueda/oblivion
# Standard imports
from typing import Tuple
# pylint: disable=too-many-lines
# Primes up to 4 ** 8 * 16 (1048576)
PRIMES: Tuple[int, ...] = (
2, 3, 5, 7, 11, 13, 17, 19,
23, 29, 31, 37, 41, 43, 47, 53,
59, 61, 67, 71, 73, 79, 83, 89,
97, 101, 103, 107, 109, 113, 127, 131... | StarcoderdataPython |
3259775 | <reponame>brandenc40/groupme-bot<filename>groupme_bot/bot.py
from __future__ import annotations
import re
from collections import OrderedDict
from json.decoder import JSONDecodeError
from typing import Any, List, Callable, Optional
import httpx
from starlette.requests import Request
from starlette.responses import Pl... | StarcoderdataPython |
8980 | from __future__ import print_function # Python 2/3 compatibility
from gremlin_python import statics
from gremlin_python.structure.graph import Graph
from gremlin_python.process.graph_traversal import __
from gremlin_python.process.strategies import *
from gremlin_python.driver.driver_remote_connection import DriverR... | StarcoderdataPython |
3200577 | <filename>deploy/scripts/combine_charts.py
#! /usr/bin/env python3
"""
Update the Helm chart version with the specified version.
"""
import argparse
from pathlib import Path
from jinja2 import Environment, PackageLoader, select_autoescape
helm_dir = Path(__file__).resolve().parent.parent / "helm"
# Map the chart na... | StarcoderdataPython |
1714802 | <gh_stars>0
import os
from typing import Optional, List
import tweepy
class Twitter:
def __init__(self) -> None:
super().__init__()
bearer_token = os.environ.get("TWITTER_API_BEARER_TOKEN")
self.twitter = tweepy.Client(bearer_token)
def get_user_id(self, dev) -> Optional[int]:
... | StarcoderdataPython |
3212504 | <filename>caffe2/python/operator_test/mean_op_test.py
# Copyright (c) 2016-present, Facebook, 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/LICEN... | StarcoderdataPython |
3396704 | <reponame>sanqingqu/ros_lane_departure_warning<gh_stars>1-10
#!/usr/bin/python3
import torch, os, cv2, sys
import argparse
from PIL import Image
from model.model import parsingNet
from utils.common import merge_config
from utils.dist_utils import dist_print
import torch
import scipy.special, tqdm
import numpy as np
im... | StarcoderdataPython |
1705957 | <filename>alpharotate/utils/gwd.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import tensorflow as tf
sys.path.append('../..')
# from utils.gaussian_wasserstein_distance import get_element1, get_element4
from alphar... | StarcoderdataPython |
1619284 | <filename>examples/blink.py
if __name__ == '__main__':
from time import sleep
from pino.config import Config
from pino.ino import HIGH, LOW, OUTPUT, Arduino, Comport
config = Config("./examples/sample.yaml")
com = Comport.derive(config.comport) \
.deploy() \
.connect()
# com =... | StarcoderdataPython |
1660585 | <filename>poc/blockbuilder.py
#utility to help making big builds, if you it 2 blocks, it fills the gap in between
from mcpi.minecraft import Minecraft
from mcpi import block
mc = Minecraft.create()
pos = mc.player.getPos()
mc.player.setPos(pos.x, pos.y +5, pos.x)
noOfPos = 0
while True:
blockHits = mc.events.poll... | StarcoderdataPython |
3311925 | <gh_stars>0
from unityagents import UnityEnvironment
import numpy as np
import random
import torch
from collections import deque
import matplotlib.pyplot as plt
import time
import gc
import cv2
import logging
import sys
logger = logging.getLogger("unityagents")
logger.propagate = False
env = UnityEnvironment(file_nam... | StarcoderdataPython |
3287115 | __author__ = '<NAME>'
__email__ = '<EMAIL>'
__date__ = '14/Mar/2017'
import sys
import requests
import config
from utils import feed_utils
def add_user_to_project(project_id, user_id, membership_type):
try:
json_body = {"membership_type": membership_type}
response = requests.post(config.api_url(... | StarcoderdataPython |
1728498 | import itertools as it
import bisect
def gen_primes():
D = {}
n = 2
while True:
if n not in D:
yield n
D[n * n] = [n]
else:
for p in D[n]:
D.setdefault(p + n, []).append(p)
del D[n]
n += 1
if __name__ == "__main__":
... | StarcoderdataPython |
1610282 | <gh_stars>1-10
#!/usr/bin/python2
"""
This code finds a free port
"""
import socket
# find a free port
def get_free_port():
"""get a single random port"""
sock = socket.socket()
sock.bind(('', 0))
port = sock.getsockname()[1]
sock.close()
return port
print(get_free_port()) | StarcoderdataPython |
169993 | <reponame>tcmal/ah-project
from tkinter import *
from tkinter.ttk import *
import tkinter.filedialog as filedialog
import tkinter.messagebox as messagebox
from config import LocalFile
from hash import sha256
from common import bool_to_tick
from views import ViewHasBackButton
from views.verify import VerifyHis... | StarcoderdataPython |
3337362 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-26 13:08
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('partner', '0077_auto_20180911_0946'),
]
operations =... | StarcoderdataPython |
4811051 | # Copyright 2018 Luddite Labs Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | StarcoderdataPython |
3232450 | <filename>app/grandchallenge/workstation_configs/migrations/0001_initial.py<gh_stars>1-10
# Generated by Django 2.2.6 on 2019-10-15 09:57
import uuid
import django.core.validators
import django.db.models.deletion
import django_extensions.db.fields
from django.conf import settings
from django.db import migrations, mod... | StarcoderdataPython |
1700219 | <reponame>bheinzerling/dougu
import re
from pathlib import Path
from .io import sentencepiece_load
from .embeddingutil import load_word2vec_file
class BPEmb():
"""
Load a BPEmb model, preprocess text, encode/decode BPE using
sentencepiece.
"""
def __init__(
self,
*,
... | StarcoderdataPython |
3338427 | <gh_stars>1-10
'''
1. GaussianMap method TopoGraph generation
im2skeleton.py
skeleton2topoMap.py
graphClass.py
reprsntAndMatching.py
---
2. Generate water throughtput for each path-pixel, generate passage on top of the count, close the room by break the passage.(where river is the skeleton pixel, rainDrop is each pixel... | StarcoderdataPython |
1615242 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | StarcoderdataPython |
3397675 | import time
import os
import os.path as path
import sys
import yaml
import json
import math
import numpy as np
import pandas as pd
from getting_data import load_sample
from ranker_helper import get_scores
from s2search_score_pdp import compute_pdp
pd.options.display.float_format = '{:,.10f}'.format
pd.set_option('displ... | StarcoderdataPython |
4830494 | <gh_stars>10-100
from collections import OrderedDict
import os
import sys
sys.path = [os.path.abspath(os.path.dirname(__file__))] + sys.path
os.environ['is_test_suite'] = 'True'
import classifiers as classifier_tests
import regressors as regressor_tests
training_parameters = {
'model_names': ['GradientBoosting',... | StarcoderdataPython |
3263952 | # Generated by Django 2.1.3 on 2019-10-22 03:05
from django.db import migrations, models
import phonenumber_field.modelfields
class Migration(migrations.Migration):
dependencies = [
('w2r', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='registro',
... | StarcoderdataPython |
3268772 | <gh_stars>0
from rest_framework.renderers import JSONRenderer
from rest_framework.negotiation import DefaultContentNegotiation
class JSONDefaultRendererContentNegotiation(DefaultContentNegotiation):
"""http://www.django-rest-framework.org/api-guide/content-negotiation/#example"""
def select_renderer(self, req... | StarcoderdataPython |
1681838 | from django.contrib import admin
from django.contrib.auth.models import Group
from .models import Item, Contact
class ItemAdmin(admin.ModelAdmin):
list_display = ('price', 'description', 'seller', )
class ContactAdmin(admin.ModelAdmin):
list_display = ('name', 'email', 'location', 'item', 'interest', )
ad... | StarcoderdataPython |
3203393 | from multiprocessing.pool import AsyncResult, ThreadPool
__thread_pools = {}
def __get_thread_pool(name) -> ThreadPool:
if name not in __thread_pools:
__thread_pools[name] = ThreadPool(10)
return __thread_pools[name]
def in_background(fn) -> AsyncResult:
return __get_thread_pool('default').app... | StarcoderdataPython |
1700951 | <reponame>sdispater/poet
# -*- coding: utf-8 -*-
from poet.installer import Installer
from poet.repositories import PyPiRepository
from poet.package import PipDependency
foo_dependency_123 = PipDependency('foo', '1.2.3')
foo_dependency_133 = PipDependency('foo', '1.3.3')
bar_dependency_321 = PipDependency('bar', '3.2... | StarcoderdataPython |
1761471 | <filename>bento/private/_yaku/examples/example4.py
import os
import sys
from yaku.context \
import \
get_bld, get_cfg
from yaku.scheduler \
import \
run_tasks
def configure(ctx):
# The tool ctask works as follows:
# - When a tool is *loaded* (load_tool), get its configure function (dum... | StarcoderdataPython |
3220480 | <gh_stars>0
import logging
import subprocess
import configparser
import os
class SSH:
def __init__(self, username, ip, port, identity_file):
self.username = username
self.ip = ip
self.port = port
self.identity_file = identity_file
def connection_str(self):
return '{}@{... | StarcoderdataPython |
3347719 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# FEDERAL UNIVERSITY OF UBERLANDIA
# Faculty of Electrical Engineering
# Biomedical Engineering Lab
# ------------------------------------------------------------------------------
# Author: <NAME>
# Contact: <EMAIL... | StarcoderdataPython |
1739851 | <reponame>bbhunter/Ghostwriter<gh_stars>1-10
"""This contains customizations for displaying the Shepherd application models in the admin panel."""
# Django Imports
from django.contrib import admin
# 3rd Party Libraries
from import_export.admin import ImportExportModelAdmin
from .models import (
ActivityType,
... | StarcoderdataPython |
4815639 | #!/usr/bin/python3
from services.assistant_services_base import AssistantServicesBase
from .skill import SkillInput, Skill
from neo4j import GraphDatabase
from typing import List
class FAQSkill(Skill):
"""Lets the assistant answer FAQ questions for the user based on LTU website info."""
def __init__(self):... | StarcoderdataPython |
3399324 | from distutils.core import setup
name = 'pyPaSWAS'
setup(
#Information about the package
name=name,
version='0.1.0',
description='Python implementation of Smith-Waterman on CUDA',
author='<NAME>',
author_email='<EMAIL>',
url='http://trac.nbic.nl/' + name.lower(),
license='', #TODO Prov... | StarcoderdataPython |
3358519 | """
Convert a Binary Search Tree to a sorted Circular Doubly-Linked List in place.
You can think of the left and right pointers as synonymous to the predecessor and successor pointers in a doubly-linked list. For a circular doubly linked list, the predecessor of the first element is the last element, and the successor... | StarcoderdataPython |
3373009 | import pickle
from PIL import Image
import matplotlib.pyplot as plt
import cv2
import copy
#read through open-cv
img = cv2.imread("mining_map.png")
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
#read through PIL
im = Image.open("mining_map.png")
pix = im.load()
Goldlist = {}
for x in range (0,im.width):
... | StarcoderdataPython |
1607291 | <filename>owl_system/AutomatizacionGUI.py<gh_stars>0
#pip install tk
import tkinter as tk
from tkinter import ttk
from tkinter import filedialog
import os.path
import webbrowser
from AutomatizacionEmpleado import AutomatizacionEmpleado
class Application(ttk.Frame):
expediente = ''
def __init__(self, mai... | StarcoderdataPython |
1688620 | <filename>core/objs/rh_gasto_suportado.py
# !/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
ERP+
"""
__author__ = '<NAME>'
__credits__ = []
__version__ = "1.0"
__maintainer__ = "<NAME>"
__status__ = "Development"
__model_name__ = 'rh_gasto_suportado.RHGastoSuportado'
import auth, base_models
from orm import *
from ... | StarcoderdataPython |
3265501 | <gh_stars>1-10
import numpy as np
from TDTensor import TDTensor
from trainingDataGeneratorTensor import datageneratorTensor as datagenerator
def experiment(data_train, data_valid, data_test, ku, kv, kr, max_epoch = 10, SGDstep = 0.001):
# def experiment(data_train, data_valid, data_test, K, max_epoch=10, SGDstep=0.001... | StarcoderdataPython |
1777839 | <filename>rapidsms/contrib/handlers/handlers/keyword.py
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import re
from django.core.exceptions import ObjectDoesNotExist
from ..exceptions import HandlerError
from .base import BaseHandler
class KeywordHandler(BaseHandler):
"""
This handler type can be sub... | StarcoderdataPython |
1794757 | <filename>string/string_half_alike.py<gh_stars>0
"""
1704. Determine if String Halves Are Alike
https://leetcode.com/problems/determine-if-string-halves-are-alike/
You are given a string s of even length. Split this string into two halves of equal lengths, and let a be the first half and b be the second half.
Two st... | StarcoderdataPython |
1698884 | <gh_stars>0
from .pyfdb import *
| StarcoderdataPython |
1738474 | <reponame>skylovead/StrategyEase-Python-SDK<filename>tests/strategyease_sdk/joinquant/test_executor.py
# -*- coding: utf-8 -*-
import collections
import datetime
import inspect
import logging
import os
import unittest
import six
from six.moves import configparser
if six.PY2:
ConfigParser = configparser.RawConfig... | StarcoderdataPython |
3319115 | <gh_stars>0
from Jumpscale import j
from .SerializerBase import SerializerBase
class SerializerJSXObject(SerializerBase):
def __init__(self):
SerializerBase.__init__(self)
def dumps(self, obj, test=True):
"""
obj is the dataobj for JSX
j.data.serializers.jsxdata.dumps(..
... | StarcoderdataPython |
9759 | # SQL output is imported as a pandas dataframe variable called "df"
# Source: https://stackoverflow.com/questions/19441730/trimmed-mean-with-percentage-limit-in-python
import pandas as pd
import matplotlib.pyplot as plt
from scipy.stats import tmean, scoreatpercentile
import numpy as np
def trimmean(arr, percent):
... | StarcoderdataPython |
3337266 | <filename>common_pyutil/io.py
from typing import List, Callable, Union
def prompt(string: str, p_t: Union[str, set], p_f: Union[str, set]) -> bool:
"""Prompt for input and return a boolean value.
Args:
string: Prefix string to input
p_t: Any of the `True` prompts
p_f: Any of the `Fals... | StarcoderdataPython |
4807473 | from typing import List, Dict, Any, Iterable
from dataclasses import dataclass
@dataclass(
init=True,
frozen=True,
)
class TableKey:
collection: str
name: str
version: int
@staticmethod
def from_row(row: List[str]) -> "TableKey":
return TableKey(collection=row[1], name=row[2], ver... | StarcoderdataPython |
146519 | # -- coding: utf-8 --
import os
from unittest import main, TestCase
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
class... | StarcoderdataPython |
1616744 | <gh_stars>0
from wms.database import sql as _sql
create_connection = _sql.create_connection
| StarcoderdataPython |
3337366 | <filename>Python_Projects/OS-app/Chat application.py
"""
This is the central file of the application.
It will update and download the main software so you will never need to come here
to obtain the newest version of the software! I plan on expanding this concept, but
for now I will only stay with this app.
"""
from u... | StarcoderdataPython |
1649688 | <reponame>kennydn99/tf-pose-estimation
import argparse
import logging
import time
import math
import cv2
import numpy as np
from tf_pose.estimator import TfPoseEstimator
from tf_pose.networks import get_graph_path, model_wh
logger = logging.getLogger("TfPoseEstimator-WebCam")
logger.setLevel(logging.DEBUG)
ch = logg... | StarcoderdataPython |
1792219 | <reponame>gferreira/zdogpy<filename>Lib/zDogPy/boilerplate.py
'''Boilerplate & utils'''
import math
TAU = math.pi * 2
def lerp(a, b, t):
return (b - a) * t + a
# def powerMultipliers(a):
# if a == 2:
# return a * a
# elif a == 3:
# return a * a * a
# elif a == 4:
# return a *... | StarcoderdataPython |
3317989 | import os
from filefind.config import load_config
def test_post_process_config():
config = load_config(['-i', '*.cpp *.h', '--include', '*.hpp'])
assert config.include == ['*.cpp', '*.h', '*.hpp']
assert config.exclude == []
assert config.directory == os.path.abspath('.')
def test_include_as_posit... | StarcoderdataPython |
1785387 | <reponame>lyclyc52/nerf_with_slot_attention
import os
val = [0, 3, 4, 23, 24, 40, 41, 42, 43, 45, 46, 48, 58, 59, 60]
for i in range(100,0, -1):
t = 'data/nerf_synthetic/clevr_1/train2/r_{:d}.png'.format(i-1)
s = 'data/nerf_synthetic/clevr_1/train2/r_{:d}.png'.format(i)
os.rename(t, s) | StarcoderdataPython |
156215 | # MIT License
#
# Copyright (c) 2017-2019 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, ... | StarcoderdataPython |
151013 | <filename>parlai/tasks/genderation_bias/agents.py<gh_stars>1-10
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Generates a controllable_gen version of a ParlAI task... | StarcoderdataPython |
5034 | import logging
import os
from datetime import datetime
from inspect import signature, Parameter
from pathlib import Path
from pprint import pprint
from textwrap import dedent
from typing import Optional, Union
import fire
import tensorflow as tf
from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint, Te... | StarcoderdataPython |
3361305 | <reponame>ahmetcagriakca/pythondataintegrator
from pdip.data import Entity
from sqlalchemy import Column, String, Integer, ForeignKey
from sqlalchemy.orm import relationship
from scheduler.domain.base import Base
class SecretSourceBasicAuthentication(Entity, Base):
__tablename__ = "SecretSourceBasicAuthenticatio... | StarcoderdataPython |
12624 | # -*- coding: utf-8 -*-
"""
Deterimines the reflectance based on r and mua.
"""
import math
import helpers.analyticalvalues as av
def reflectance(mua, r):
"""
mua: the absorption coefficient used.
r: the radial distance used.
"""
values = av.analyticalValues(r, mua)
# the value of th... | StarcoderdataPython |
173434 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-14 14:51
from __future__ import unicode_literals
from django.db import migrations, models
import filebrowser.fields
class Migration(migrations.Migration):
dependencies = [
('vvphotos', '0002_auto_20170414_1207'),
]
operations = [
... | StarcoderdataPython |
9591 | from typing import Optional
import pandas as pd
from ruptures import Binseg
from ruptures.base import BaseCost
from sklearn.linear_model import LinearRegression
from etna.transforms.base import PerSegmentWrapper
from etna.transforms.decomposition.change_points_trend import BaseEstimator
from etna.transforms.decomposi... | StarcoderdataPython |
3264676 | import os
import sys
from datetime import datetime
from netCDF4 import date2num
from pyniva import Vessel, TimeSeries, token2header
import pandas as pd
from ferrybox import ferryBoxStationClass as fb
import csv
__author__ = '<NAME>'
__email__ = '<EMAIL>'
__created__ = datetime(2019, 1, 22)
__modified__ = datetime(2020... | StarcoderdataPython |
1736652 | <reponame>lakhlaifi/RedHat-Ansible
#
# (c) 2017 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) ... | StarcoderdataPython |
1681928 | try:
import pyimageocr
except Exception as e:
print("Error...", e)
print('Character : Accuracy')
ocr = pyimageocr.OCR(mode='en')
# ocr.train("Training")
print("Trainning Done !!")
a = ocr.pattern_match(file="Test/1-img015-00045.png")
print(a)
# ocr.tlableshresoldImage()
# ocr.getimageHistogram()
# ocr.imageShow()
#... | StarcoderdataPython |
168763 | <filename>odoo-13.0/addons/payment/models/__init__.py<gh_stars>0
# -*- coding: utf-8 -*-
from . import payment_acquirer
from . import account_invoice
from . import res_partner
from . import account_payment
from . import chart_template
from . import ir_http
from . import res_company
| StarcoderdataPython |
1668895 | <filename>experiments/001_dominance_comparison.py
import pickle
from pprint import pprint
import numpy as np
from acs.objective import reduce_objectives
from utils.multiobjective import dominates, sort_nondominated
# Compares how many solution obtained by NSGA are dominated by the solution
# obtained by GA for ever... | StarcoderdataPython |
3262371 | import discord
from discord.ext import commands
from jikanpy import Jikan
from datetime import datetime
from dotenv import load_dotenv
from os import getenv
from services import utils
from services.anime import anime
from services.search import search
from services.schedule import schedule
PREFIX = '!'
load_dotenv('e... | StarcoderdataPython |
1799541 | <reponame>eneskums/ogrenciBilgiSistemi
from django.conf.urls import url
from .views import *
app_name= 'dersicerik'
urlpatterns = [
url(r'^dersicerikTalep/$', dersicerikTalep, name='dersicerikTalep'),
url(r'^dersicerikIstek/$', dersicerikIstekleri, name='dersicerikIstek'),
url(r'^dersicerikIstekleriDetay/... | StarcoderdataPython |
84736 | <filename>vesper/django/app/tests/dtest_model_attributes.py<gh_stars>0
from vesper.django.app.models import (
AnnotationConstraint, AnnotationInfo, Device, DeviceModel, Processor,
Station, TagInfo)
from vesper.django.app.tests.dtest_case import TestCase
class ModelAttributeTests(TestCase):
def s... | StarcoderdataPython |
126214 | # @Author : guopeiming
# @Contact : <EMAIL>, 163}.com
from config import Constants
from configparser import ConfigParser
class MyConf(ConfigParser):
"""
MyConf
"""
def __init__(self, config_file, *args, **kwargs):
super(MyConf, self).__init__(*args, **kwargs)
self.read(filenames=config... | StarcoderdataPython |
92587 | <reponame>wissembrdj/welink
class PretreatedQuery:
'''
DBpedia resultat
'''
def __init__(self, mentions_list, detected_ne):
'''
Constructor
'''
self.mentions_list=mentions_list
self.detected_ne=detected_ne
| StarcoderdataPython |
1647765 | # input para capturar a entrada do usuário
nome = input("Qual o seu nome: ")
idade = input("Qual a sua idade: ")
print ("Olá", nome, "sua idade é", idade) | StarcoderdataPython |
3286976 | from django.views.generic.edit import CreateView
from django.contrib import messages
from django.urls import reverse_lazy
from django.utils.translation import gettext as _
from .forms import ContactForm
from .models import ContactsList
class ContactFormView(CreateView):
template_name = "contact/contact.html"
... | StarcoderdataPython |
53614 | import pandas as pd
import re
import requests
from bs4 import BeautifulSoup
from time import sleep
from .requester import Requester
class Crawler:
"""
"""
def __init__(self, url, sarcasm, as_archived=False):
self.__url = url
self.__sarcasm = sarcasm
self.__as_archived = as_archived
self.__data = list()
... | StarcoderdataPython |
37068 | <gh_stars>1-10
for i in range(1, int(input()) + 1):
quadrado = i ** 2
cubo = i ** 3
print(f'{i} {quadrado} {cubo}')
print(f'{i} {quadrado + 1} {cubo + 1}')
| StarcoderdataPython |
1786087 | <reponame>norikuro/vmcjp-slack-service
#!/usr/bin/env python
import datetime
def get_next_time(minutes):
now = datetime.datetime.now()
next_time = now + datetime.timedelta(minutes=minutes)
cron = "cron({} {} {} {} ? {})".format(next_time.minute, next_time.hour, next_time.day, next_time.month, next_time.year)
... | StarcoderdataPython |
96284 | <reponame>DirkFi/BigDL
from zoo.orca import init_orca_context, stop_orca_context
from tensorflow import keras
from zoo.pipeline.api.keras.layers import *
import argparse
import tensorflow as tf
import os
def bigdl_estimator():
from zoo.orca.learn.bigdl.estimator import Estimator
from tensorflow.python.keras.da... | StarcoderdataPython |
3373160 | # encoding: utf-8
"""
line/watchdog.py
Created by <NAME> on 2017-07-01.
Copyright (c) 2009-2017 Exa Networks. All rights reserved.
License: 3-clause BSD. (See the COPYRIGHT file)
"""
from exabgp.reactor.api.command.command import Command
from exabgp.reactor.api.command.limit import match_neighbors
from exabgp.reactor... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.