id
stringlengths
1
265
text
stringlengths
6
5.19M
dataset_id
stringclasses
7 values
3268049
<reponame>OpenHLTest/data-models """Http transport class with CRUDX implementations of Transport methods """ import sys import json from requests import Session, Response from openhltest_client.transport import Transport from openhltest_client.mockserver import MockServer from openhltest_client.base import Base ...
StarcoderdataPython
3246880
<reponame>lazartomi/3d-beacons-client import logging from flask import Blueprint import flask_restx from .query.endpoints import api as api_query_ns LOG = logging.getLogger(__name__) api = flask_restx.Api(version='1.0', title='3D-Beacons Client API', description='3D Beaco...
StarcoderdataPython
3339067
from abc import ABC, abstractmethod from itertools import count, cycle from typing import Generic, List, TypeVar, Union import numpy as np InstanceType = TypeVar("InstanceType") class Generator(Generic[InstanceType], ABC): """Instance generator modeling a target problem distribution for DAC as a (possibly infin...
StarcoderdataPython
1782921
# # Copyright (c) 2019 One Identity # # 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, publish, di...
StarcoderdataPython
4812126
<reponame>Najiva/django-tables2-column-shifter<gh_stars>10-100 # encoding:utf-8 from django.conf.urls import url from .views import ( Bootstrap2, Bootstrap3, Bootstrap4, Bootstrap4_1_3, Bootstrap5, Index, ) urlpatterns = [ url(r'^$', Index.as_view(), name="index"), url(r'^bootstrap2/$'...
StarcoderdataPython
180336
# -*- coding: utf-8 -*- """ Created on Sat Apr 02 20:35:11 2016 @author: perrytsao """ import numpy as np import matplotlib.pyplot as plt import sys import glob import os plt.close('all') if len(sys.argv)>1: fltname='flight_data\\'+sys.argv[1] else: search_dir = "flight_data\\" # remove anything fro...
StarcoderdataPython
3234815
<reponame>mkpetterson/Cancer_Prediction import numpy as np import os import sys import matplotlib.pyplot as plt import cv2 import imageio import scipy from skimage.transform import radon, rescale def fft(img_path): """ FFT of histology images (.png)""" img_name = os.path.splitext(img_path)[0] ...
StarcoderdataPython
39098
<filename>quantize-gym/gym/envs/robotics/fetch/pick_and_place.py<gh_stars>1-10 import os from gym import utils from gym.envs.robotics import fetch_env # Ensure we get the path separator correct on windows MODEL_XML_PATH = os.path.join('fetch', 'pick_and_place.xml') class FetchPickAndPlaceEnv(fetch_env.FetchEnv, uti...
StarcoderdataPython
148007
<gh_stars>0 #!/usr/bin/env python3 import sys import json def demo01(): with open(sys.argv[1]) as f: data = json.load(f) inst = data['instruments'] i = 0 d = {} # name, channel, program, lownotes, highnotes for k, v in inst.items(): n = v.replace(' ', '') d[n] = [v, 0, i...
StarcoderdataPython
184226
<reponame>S1NGer-iwni/ICQ_Bot import json import random from googlesearch import search from bot.bot import Bot from bot.handler import MessageHandler, BotButtonCommandHandler import requests from bs4 import BeautifulSoup as BS TOKEN = "" bot = Bot(token = TOKEN) cities = [ 'москва','санкт-петер...
StarcoderdataPython
50291
def longestDigitsPrefix(inputString): # iterate through the string arr = '' for i in inputString: if i.isdigit(): arr += i else: break return arr
StarcoderdataPython
3379125
from tkinter import * from tkinter.messagebox import * from time import localtime as lc from datetime import datetime as dt # Criação da janela principal sistema = Tk() sistema.title('Mynelle - Sistema de Pausas') # Definição de título sistema.iconbitmap('imagens/clock.ico') # Criando painel painel_texto = StringV...
StarcoderdataPython
3226946
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from...
StarcoderdataPython
1722596
import time from typing import Tuple, Union from .Updateable import Updateable class KinematicObject(Updateable): """ Stores 3D position, velocity, and acceleration data for translation and rotation Standard units for translation are m, m/s, m/s^2 Standard units for rotation are deg, rpm, rpm/s ...
StarcoderdataPython
30868
#BEGIN_HEADER #END_HEADER ''' Module Name: MetaboliteAtlas Module Description: A web-based atlas to liquid chromatography–mass spectrometry (LCMS) data ''' class MetaboliteAtlas: #BEGIN_CLASS_HEADER #END_CLASS_HEADER def __init__(self, config): #config contains contents of config file in hash or ...
StarcoderdataPython
1735770
<reponame>exxamalte/python-aio-georss-client<filename>aio_georss_client/geo_rss_distance_helper.py """GeoRSS Distance Helper.""" import logging from typing import Optional, Tuple from haversine import haversine from .xml_parser.geometry import BoundingBox, Geometry, Point, Polygon _LOGGER = logging.getLogger(__name_...
StarcoderdataPython
193139
<gh_stars>0 # Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
StarcoderdataPython
148023
# -*- coding: utf-8 -*- """ Tests using pytest_resilient_circuits use the environment variable TEST_RESILIENT_APP_CONFIG to refer to the app.config file for testing """ from __future__ import print_function import datetime import logging import pytest import sys if sys.version_info.major == 3: from unittest.mock i...
StarcoderdataPython
1631081
#!/usr/bin/env python3 import pexpect import sys child = pexpect.spawn('ssh sdnnetconf@172.16.17.32') fout=file('pexpect.log','w') child.logfile = fout #child.logfile = sys.stdout password='<PASSWORD>' child.expect('password:') child.sendline("SDN_conf@2018") child.expect('>') child.sendline("ping -a 172.16.17.32 172....
StarcoderdataPython
128
<reponame>YinAoXiong/ZCls # -*- coding: utf-8 -*- """ @date: 2021/5/16 下午10:22 @file: test_shufflenetv1.py @author: zj @description: """ import torch from zcls.config import cfg from zcls.config.key_word import KEY_OUTPUT from zcls.model.recognizers.build import build_recognizer def test_data(model): data = t...
StarcoderdataPython
3222174
# xyz Sep 2018 from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from datasets.all_datasets_meta.datasets_meta import DatasetsMeta from models.conv_util import ResConvOps, gather_second_d from utils.tf_util import TfUtil DEBUG = False...
StarcoderdataPython
3206121
<reponame>lzy7071/wc_kb<gh_stars>0 """ Tests of the knowledge base IO :Author: <NAME> <<EMAIL>> :Author: <NAME> <<EMAIL>> :Date: 2018-02-07 :Copyright: 2018, Karr Lab :License: MIT """ from wc_kb import core, prokaryote_schema from wc_kb import io import Bio.Seq import Bio.SeqRecord import filecmp import obj_model.io...
StarcoderdataPython
4807604
<reponame>tguillemLSST/eotest #!/usr/bin/env python """ @brief Dark pixels task: Find pixels and columns in a median image constructed from an ensemble of superflats. The dark pixel threshold is specified via the --thresh option and is in units of fraction of the segment mean. The threshold for the number of dark pi...
StarcoderdataPython
3379153
<gh_stars>1-10 from django.urls import path from django.conf.urls import url from project.views import health from django.urls.conf import include from .views import table_to_dataframe, redirect_form, json_table_list, post_url urlpatterns = [ path('table/', table_to_dataframe, name="table"), path('redirect_form/<...
StarcoderdataPython
1675381
<filename>formation/tests/test_base.py from unittest import TestCase from unittest.mock import Mock, patch from formation import base from formation.tests import mock class TestBindParseValidate(TestCase): def test_can_be_instantiated_without_data(self): unbound = base.BindParseValidate() self.as...
StarcoderdataPython
3268270
<gh_stars>1-10 import numpy as np def dataset_sampler(dataset, sampling_method='sqrt'): """Function to sample a single sub-dataset from a meta-dataset. Args: dataset (object): dataset class with .lens as property. This must be a dictionary with sub-datasets as keys and sizes as values. sampli...
StarcoderdataPython
165620
###################################################################### ###################################################################### # Copyright <NAME>, Cambridge Dialogue Systems Group, 2017 # ###################################################################### #############################################...
StarcoderdataPython
3245908
<filename>py/constant.py # 데이터 저장 경로 PATH = '../datas/' # 대분류 카테고리별 컬럼 구분 CAT = {'economy': ['PERCENTAGE_EXPENDITURE', 'TOTAL_EXPENDITURE', 'GDP', 'POPULATION', 'INCOME_COMPOSITION_OF_RESOURCES'], 'death_rate': ['INFANT_DEATHS', "ADULT_MORTALITY", 'UNDER_FIVE_DEATHS'], 'illness_rate': ...
StarcoderdataPython
4809255
<reponame>jlind062/flippin_flask<gh_stars>1-10 import csv import re import os import scrape import json class CSVManager: def __init__(self, **kwargs): self.path = kwargs.get('path') self.sources = kwargs.get('sources') if not self.get_csvs(): raise NotADirectoryError("There is...
StarcoderdataPython
3335959
# -*- coding: utf-8 -*- """ @author:XuMing(<EMAIL>) @description: train seq2seq model # #### PyTorch代码 # - [seq2seq-tutorial](https://github.com/spro/practical-pytorch/blob/master/seq2seq-translation/seq2seq-translation.ipynb) # - [Tutorial from <NAME>](https://github.com/bentrevett/pytorch-seq2seq) # - [IBM seq2seq](...
StarcoderdataPython
148863
# Generated by Django 3.1.4 on 2021-01-03 04:23 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='HabixUser', fields=[ ...
StarcoderdataPython
80232
#!/usr/bin/env python # -*- coding:utf-8 -*- from distutils.core import setup setup(name = 'foolnltk', version = '0.0.8', description = 'Fool Nature Language toolkit ', author = 'wu.zheng', author_email = '<EMAIL>', url = 'https://github.com/rockyzhengwu/FoolNLTK', packages = ['fool'], p...
StarcoderdataPython
3392758
from django.shortcuts import render, redirect from django.http import HttpResponse from .models import ArticlePost from .forms import ArticlePostForm from django.contrib.auth.models import User # Create your views here. def helloworld(request): return HttpResponse("hello world") def show_course(request): retu...
StarcoderdataPython
4841313
#!/usr/bin/python3 # -*- coding: utf-8 -*- # *****************************************************************************/ # * Authors: <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME> # *****************************************************************************/ from __future__ import absolute_import, di...
StarcoderdataPython
96019
<filename>solutions/337.py<gh_stars>0 # 337. House Robber III # Leetcode solution(approach 1) # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def rob(self,...
StarcoderdataPython
1605291
import numpy as np import matplotlib.pyplot as plt plt.figure(1) plt.clf() plt.axis([-10, 10, -10, 10]) # Define properties of the "bouncing balls" n = 10 pos = (20 * np.random.sample(n*2) - 10).reshape(n, 2) vel = (0.3 * np.random.normal(size=n*2)).reshape(n, 2) sizes = 100 * np.random.sample(n) + 100 # Colors wher...
StarcoderdataPython
1715288
from mimas.helper.arguments import Arguments from mimas.spectra.library_search.untarget_search import untarget_search from mimas.spectra.library_search.target_search import target_search from mimas.spectra.library_search.file_adaptor import AdaptorSpecFile, AdaptorIndexFile, AdaptorSimilarityResult def main(para): ...
StarcoderdataPython
44318
<gh_stars>1-10 #!/usr/bin/env python from __future__ import print_function import os import matplotlib matplotlib.use('Agg') import pylab as plt import numpy as np from numpy.fft import fftn, ifftn import scipy.integrate as integrate from scipy import stats import PlotScripts import ReadScripts import AllVars def...
StarcoderdataPython
1779132
<filename>website/bussen/__init__.py<gh_stars>0 default_app_config = "bussen.apps.BussenConfig"
StarcoderdataPython
3255092
# Copyright 2011, 2013 OpenStack Foundation # Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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
1630784
from multimds import compartment_analysis as ca from multimds import data_tools as dt from scipy import stats as st from matplotlib import pyplot as plt import numpy as np from multimds import linear_algebra as la from scipy import signal as sg from multimds import multimds as mm path1 = "hic_data/GM12878_combined_19_...
StarcoderdataPython
1768765
<filename>indico_toolkit/__init__.py """A package to support Indico IPA development""" __version__ = "1.2" from .errors import * from .client import create_client from .retry import retry
StarcoderdataPython
1792190
<reponame>NickNeedsAName/tornado #!/usr/bin/env python # # Copyright 2011 Facebook # # 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 # # Unles...
StarcoderdataPython
184266
""" Tests related to datastore """ import json import unittest import pathlib import requests from run import run_storage_app_process from settings import DATASTORE_APP_ADDRESS from modules.common import build_url class TestingDatastore(unittest.TestCase): """ Tests related to datastore. """ datapat...
StarcoderdataPython
3393471
import collections import itertools import json from collections import Iterable _State = collections.namedtuple("State", ["toplevel", "computed", "resolving"]) def _check_type_all(iterable, type): for item in iterable: if not isinstance(item, type): return False return True def _is_lis...
StarcoderdataPython
37559
import numpy as np from .common import * from . import rotation def to_homogeneous(x): x = np.asarray(x) o = np.ones_like(x[..., :1]) return np.concatenate([x, o], axis=-1) def from_homogeneous(x): return x[..., :-1] / x[..., -1:] def compose(r, t, rtype, out=None): if out is None: shape ...
StarcoderdataPython
1634730
""" desisim.qso_template ==================== Stuff dealing with QSO templates. """
StarcoderdataPython
1742027
from collections import defaultdict, OrderedDict from typing import Any, Dict, List, Tuple import tqdm import torch import torch.nn as nn from torch.utils.data import DataLoader import cv_lib.distributed.utils as dist_utils import cv_lib.metrics as metrics from vit_mutual.loss import Loss from vit_mutual.utils impor...
StarcoderdataPython
1748462
import matplotlib.pyplot as plt import statsmodels.api as sm from tsdata import generate_sample_data sample_ts, _ = generate_sample_data() ts_fig, ts_ax = plt.subplots(tight_layout=True) sample_ts.plot(ax=ts_ax, label="Observed") ts_ax.set_title("Time series data") ts_ax.set_xlabel("Date") ts_ax.set_ylabel("Value")...
StarcoderdataPython
4333
#coding: utf-8 from gevent import monkey monkey.patch_all() from gevent.pool import Pool import gevent import requests import urllib import os import time import re import ssl class Downloader: def __init__(self, pool_size, retry=3): self.pool = Pool(pool_size) self.session = self._get_http_sessio...
StarcoderdataPython
1621914
<reponame>Jintao-Huang/EfficientDet_PyTorch # Author: <NAME> # Time: 2020-6-6 from .utils import to, collate_fn from torch.utils.data import DataLoader import torch class RuntimeErrorHandler: def __init__(self, ignore_num): self.ignore_num_ori = self.ignore_num = ignore_num def error(self, e): ...
StarcoderdataPython
4817461
<reponame>anthonyjatoba/codewars def is_even(n): return n%2==0 def iq_test(numbers): numbers = [int(n) for n in numbers.split()] n_even = sum(is_even(n) for n in numbers[:3]) if n_even > 3 - n_even: # achar o impar for i in range(len(numbers)): if not is_even(numbers[i]): ...
StarcoderdataPython
155081
"""MS COCO Key Points Evaluate Metrics.""" from __future__ import absolute_import import os from os import path as osp from collections import OrderedDict import warnings try: from mxnet.metric import EvalMetric except ImportError: from mxnet.gluon.metric import EvalMetric class COCOKeyPointsMetric(EvalMetric...
StarcoderdataPython
3264016
# pylint: disable=global-statement,redefined-outer-name """ Module to wrap AWS Cognito APIs """ import json import sys from dataclasses import dataclass import boto3 @dataclass(frozen=True) class CognitoGroup: """ Class for AWS Cognito group """ name: str description: str @dataclass(frozen=True) class...
StarcoderdataPython
3201214
<filename>fuji_server/helper/catalogue_helper.py # -*- coding: utf-8 -*- import enum import logging class MetaDataCatalogue(object): """ A base class of to access a metadata catalogue Attributes ---------- apiURI : str The URI for API of metadata catalogue Sources : enum.Enum Enum ...
StarcoderdataPython
3369677
<reponame>Kataiser/fast-package-file import base64 import lzma import os import unittest import fast_package_file class TestTF2RichPresenseFunctions(unittest.TestCase): def setUp(self): if 'test_dir' not in os.getcwd(): os.chdir('test_dir') # tests building packages against the reference...
StarcoderdataPython
1721098
<gh_stars>1-10 from logging import getLogger from django.core.cache import cache from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver from django.contrib.auth.models import User from django.contrib.auth.signals import user_logged_in logger = getLogger('genie_...
StarcoderdataPython
3279040
# Copyright (c) 2012 Liveperson. 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 above copyright # notice, this list of conditions and the fo...
StarcoderdataPython
1635455
<filename>Acquire/Client/_storagecreds.py __all__ = ["StorageCreds"] def _get_storage_url(): """Function to discover and return the default storage url""" return "http://fn.acquire-aaai.com:8080/t/storage" def _get_storage_service(storage_url=None): """Function to return the storage service for the sys...
StarcoderdataPython
3259943
<reponame>Francesco2304/pygfa<gh_stars>1-10 import time import sys from pympler import asizeof sys.path.insert(1, '../') import pygfa def timeit(function): def timed(*args, **kwargs): kw = kwargs.copy() if "log_data" in kwargs: kw.pop("log_data") ts = time.time() result...
StarcoderdataPython
14205
<reponame>wvu-irl/smart-2 #!/usr/bin/env python import rospy from geometry_msgs.msg import Twist from math import radians import os import numpy as np from nav_msgs.msg import Odometry class DrawASquare(): def __init__(self): # initiliaze rospy.init_node('drawasquare', anonymous=True) #...
StarcoderdataPython
3361732
<gh_stars>1-10 import jax from jax import lax, vmap import jax.numpy as jnp import haiku as hk from jax_md import space, partition, nn, util, energy, smap from jax_md.energy import multiplicative_isotropic_cutoff, _sw_radial_interaction, _sw_angle_interaction from DiffTRe import custom_nn, custom_interpolate from funct...
StarcoderdataPython
3284936
<filename>msap/modeling/model_selection/preprocessing/impute.py # -*- coding: utf-8 -*- """Missing value imputation methods. Authors: <NAME> - <EMAIL> <NAME> - <EMAIL> """ import sys import warnings # missingpy and sklearn compatibility import sklearn.neighbors._base sys.modules['sklearn.neighbors.base'] = s...
StarcoderdataPython
125732
<filename>rpi/interactive.py from rpi_ws281x import PixelStrip, ws, Color # LED strip configuration: LED_COUNT = 50 # Number of LED pixels. LED_PIN = 18 # GPIO pin connected to the pixels (must support PWM!). LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 800khz) LED_DMA = 10 ...
StarcoderdataPython
3206483
#!/usr/bin/env python3 from distutils.core import setup setup(name="pcc", version="1.0.0", description="A simple connection cache for postgres that refreshes connections from time to time.", author="Mopsalarm", author_email="<EMAIL>", url="https://github.com/mopsalarm/postgres-connection...
StarcoderdataPython
119423
class Solution: def solve(self, matrix): if matrix[0][0] == 1: return -1 R,C = len(matrix),len(matrix[0]) bfs = deque([[0,0]]) dists = {(0,0): 1} while bfs: r,c = bfs.popleft() if (r,c) == (R-1,C-1): return dists[r,c] for nr,n...
StarcoderdataPython
1606110
<reponame>davidsmejia/refinebio # -*- coding: utf-8 -*- import boto3 import csv import os import rpy2 import rpy2.robjects as ro import shutil import simplejson as json import string import warnings import requests from botocore.exceptions import ClientError from datetime import datetime, timedelta from django.conf i...
StarcoderdataPython
3399919
<filename>py/DREAM/Formulas/Distributions.py<gh_stars>10-100 import numpy as np import scipy.constants import scipy.special def getRelativisticMaxwellJuttnerDistribution(p,T,n): """ Calculates the relativistic Maxwell-Jüttner distribution. :param float p: Momentum in units of m_e*c :param float T: Pl...
StarcoderdataPython
65928
from django import test from django.http import HttpResponse from django.test import override_settings from django.utils import translation from mock import mock from model_mommy import mommy from devilry.devilry_account import middleware @override_settings( LANGUAGE_CODE='en', LANGUAGES=[ ('en', 'En...
StarcoderdataPython
3234685
<reponame>Cubium/DriverDemo from GASPACS.Drivers.Driver import Driver class DummyCounter(Driver): def __init__(self): super().__init__("ElapsedTime", 0.5) self.x = 0 def update(self): self.x += 1 print("x =", self.x) return self.x
StarcoderdataPython
178121
<reponame>candyninja001/pypad from . import ActiveSkill from ..skill_loader import SkillLoader from ..region import Region from ..orb_attribute import OrbAttribute from ..common import binary_to_list, iterable_to_string class LockOrbsAS(ActiveSkill): _handle_types = {152} def parse_args(self): self.o...
StarcoderdataPython
124466
krediler = ["<NAME>", "<NAME>'tan alanlara özel", "Mutlu emekli ihtiyaç kredisi"] for kredi in krediler: print(kredi) for i in range(len(krediler)): print(krediler[i]) for i in range(3,10): #3 dahil 10 dahil değil print(i) for i in range(0,11,2): #0'dan başla 2'şer 2'şer arttır print(i)
StarcoderdataPython
1688784
""" ImageNet: VGGNet, ResNet, Inception, and Xception with Keras """ import os from tensorflow.keras.preprocessing import image from tensorflow.keras.applications import InceptionV3 from tensorflow.keras.applications.inception_v3 import preprocess_input from tensorflow.keras.applications import imagenet_utils import n...
StarcoderdataPython
1664651
<reponame>computer-geek64/fizz<gh_stars>1-10 #!/usr/bin/python3 # login_blueprint.py import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'util')) from datetime import datetime from fl...
StarcoderdataPython
3231439
<filename>WEEKS/CD_Sata-Structures/_MISC/misc-examples/python3-book-examples/shutil/shutil_which.py # Copyright (c) 2016 <NAME>. All rights reserved. # Written for https://pymotw.com # """Find a program on $PATH """ # end_pymotw_header import shutil print(shutil.which("virtualenv")) print(shutil.which("tox")) print(...
StarcoderdataPython
3233017
<reponame>AndrejHafner/tetris-reinforcement-learning<filename>dqn/main.py import time from itertools import count import time import numpy as np import torch import os from dqn.agent import Agent from tetris.tetris import Tetris if __name__ == '__main__': num_episodes = 2500 if not os.path.exists('trained_m...
StarcoderdataPython
3356947
import numpy as np import pytest @pytest.fixture def random(): np.random.seed(0)
StarcoderdataPython
66004
#!/usr/bin/env python from __future__ import print_function import argparse import os import pkgutil import sys from subprocess import check_call import kaldi parser = argparse.ArgumentParser( description="Generates autosummary documentation for pykaldi.") # parser.add_argument('--force', '-f', action='store_...
StarcoderdataPython
69666
from django.db.models import Count, Q from django.shortcuts import redirect, render from django.utils import timezone from AIST_survey.models import Enquete, Respondent, Question, Choice, Evaluation def index(request): if "enquete_id" not in request.session: return redirect("login") enquete_id = requ...
StarcoderdataPython
4825166
# -*- coding: utf-8 -*- # import wx from utils.MLogger import MLogger # noqa logger = MLogger(__name__) class ConsoleCtrl(wx.TextCtrl): def __init__(self, parent): # 複数行可、読み取り専用、枠線ナシ、縦スクロールあり、横スクロールあり、キーイベント取得あり super().__init__(parent, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(-1,...
StarcoderdataPython
4807842
import os import tempfile from igibson.examples.learning.demo_collection_example import collect_demo from igibson.examples.learning.demo_replaying_example import safe_replay_demo def test_determinism_with_new_demo(): # First record a random demo. with tempfile.TemporaryDirectory() as directory: demo_...
StarcoderdataPython
115493
<reponame>EGGS-Experiment/EGGS_Control """ Displays currently running experiments. """ from PyQt5.QtGui import QFont from PyQt5.QtCore import Qt, QSignalMapper, QSize, pyqtSignal from PyQt5.QtWidgets import QWidget, QHBoxLayout, QSizePolicy, QLabel,\ QAbstractItemView, QTableWidget, QHeaderView, QGridLayout from ....
StarcoderdataPython
1616294
<reponame>mrm-xiefan/lunania-ai import os import utils import config import traceback import argparse import logging.config from luna import LunaExcepion logging.config.fileConfig("logging.conf") logger = logging.getLogger() #os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # def parse_args(): # parser = argparse.Argum...
StarcoderdataPython
1618501
<filename>Taller Diccionarios/Punto1.py lista=[12, 23, 5, 12, 92, 5,12, 5, 29, 92, 64,23,1,1] numeros={ } for i in lista: key=str(i) a=lista.count(i) numeros.update({key: a}) print(numeros)
StarcoderdataPython
3284239
import pytest from specklepy.api.models import Stream from specklepy.objects import Base from specklepy.objects.encoding import ObjectArray from specklepy.serialization.base_object_serializer import BaseObjectSerializer from specklepy.transports.sqlite import SQLiteTransport class TestObject: @pytest.fixture(scop...
StarcoderdataPython
190913
<filename>inferlo/interop/__init__.py<gh_stars>1-10 from .libdai.libdai_interop import LibDaiInterop
StarcoderdataPython
3365482
<filename>analyzer/Builds/__init__.py from .Build import Build __all__ = [Build]
StarcoderdataPython
3275142
<reponame>jacektl/calamari import unittest from math import log10, floor from tensorflow import keras from calamari_ocr.ocr.scenario import CalamariScenario from calamari_ocr.test.test_train_file import uw3_trainer_params def round_sig(x, sig=6): return round(x, sig - int(floor(log10(abs(x)))) - 1) class Test...
StarcoderdataPython
1619894
<reponame>eieste/SSHock<filename>adminarea/forms/appintegration.py<gh_stars>0 from django import forms from adminarea.models import AppIntegration, APP_INTEGRATIONS class AppIntegrationForm(forms.ModelForm): class Meta: fields = ("platform", "display_name") model = AppIntegration
StarcoderdataPython
3330972
<gh_stars>100-1000 from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.ops import control_flow_ops from tensorflow.python.ops import math_ops from tensorflow.python.ops import state_ops from tensorflow.python.framework import ops from tens...
StarcoderdataPython
3274535
<filename>components/button.py from typing import List, Callable from pygame import Rect, Surface, mouse, BLEND_RGB_MULT, cursors from util.constants import BUTTON_CURSOR from components.label import Label from components.style import Style from components.component import Component class Button(Label): """A GU...
StarcoderdataPython
1696254
<reponame>domwillcode/home-assistant """Tests for ZHA integration init.""" import pytest from zigpy.config import CONF_DEVICE, CONF_DEVICE_PATH from homeassistant.components.zha.core.const import ( CONF_BAUDRATE, CONF_RADIO_TYPE, CONF_USB_PATH, DOMAIN, ) from homeassistant.const import MAJOR_VERSION, ...
StarcoderdataPython
128798
<gh_stars>0 """ evalfitness =========== Contains methods to evaluate the fitness of a tree. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ...
StarcoderdataPython
1710199
from openstuder import SIAsyncGatewayClient, SIProtocolError def on_error(error: SIProtocolError): print(f'Unable to connect: {error.reason()}') def on_connected(access_level: str, gateway_version: str): print(f'Connected, access level = {access_level}, gateway runs version {client.gateway_version()}') ho...
StarcoderdataPython
113511
import os from datetime import datetime import sys try: from hashlib import sha1 except ImportError: sys.exit('ImportError: No module named hashlib\n' 'If you are on python2.4 this library is not part of python. ' 'Please install it. Example: easy_install hashlib') from sqlalchemy imp...
StarcoderdataPython
3385383
import pyopencl as cl import pyopencl.array as cl_array import numpy import numpy.linalg as la a = numpy.random.rand(50000).astype(numpy.float32) b = numpy.random.rand(50000).astype(numpy.float32) ctx = cl.create_some_context() queue = cl.CommandQueue(ctx) a_dev = cl_array.to_device(queue, a) b_dev = cl_array.to_dev...
StarcoderdataPython
3291428
import os.path import re import hashlib import logging import shlex from collections import OrderedDict from . import __version__, DocoptError from .doc_ast import DocAst, Option from .bash import Code, indent, bash_ifs_value from .node import LeafNode, helper_list log = logging.getLogger(__name__) class Parser(obje...
StarcoderdataPython
182930
import matplotlib.pyplot as plt import numpy as np from SMYLEutils import colormap_utils as mycolors import cartopy.crs as ccrs import cartopy.feature as cfeature from cartopy.util import add_cyclic_point from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter import matplotlib.ticker as mticker from matpl...
StarcoderdataPython
105365
<filename>divedownload.py<gh_stars>0 from google_drive_downloader import GoogleDriveDownloader as gdd gdd.download_file_from_google_drive(file_id='14LXxwldPTV5K1EmrDr-HQc1svBhMKDvT', dest_path='./similarity.pkl', unzip=False)
StarcoderdataPython
1675102
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/105_models.RNN.ipynb (unless otherwise specified). __all__ = ['RNN', 'LSTM', 'GRU'] # Cell from ..imports import * from .layers import * # Cell class _RNN_Base(Module): def __init__(self, c_in, c_out, hidden_size=100, n_layers=1, bias=True, rnn_dropout=0, bidirecti...
StarcoderdataPython