id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
243907
<filename>filewithlock.py import codecs import os import time def wait_lock(filename): while os.path.exists(filename): time.sleep(0.001) def add_lock(filename): dirname = os.path.dirname(filename) if dirname and not os.path.exists(dirname): os.makedirs(dirname) if not os.path.exists(...
StarcoderdataPython
1710192
<gh_stars>0 class Node: def __init__(self, data, next): self.data = data self.next = next
StarcoderdataPython
1878033
import argparse import math parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group(required=True) group.add_argument('--deploy', action='store_true') group.add_argument('--test', action='store_true') def solver(inputString, node1="YOU", node2="SAN"): inputString = inputString.strip() l...
StarcoderdataPython
1701695
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Pixel Starships Market API # ----- Packages ------------------------------------------------------ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse imp...
StarcoderdataPython
3315603
""" Module classes: NewPostHandler - Handler for creating a new blog post. """ from base import BaseHandler from models.post import BlogEntry ############################################################################## class NewPostHandler(BaseHandler): """Handler for creating a new blog post.""" def re...
StarcoderdataPython
3443214
import magma def SoCDataType(addr_width, data_width): """ This function returns a class (parameterized by @addr_width and @data_width) which can be used as the magma ports with these inputs and outputs 1. rd_en 2. rd_addr 3. rd_data 4. wr_strb 5. wr_addr ...
StarcoderdataPython
5159093
#!/usr/bin/env python """Entry points for the grr-response-client-builder pip package.""" # pylint: disable=g-import-not-at-top def ClientBuild(): from grr_response_client_builder import client_build client_build.Run()
StarcoderdataPython
1795369
<reponame>dre2004/django-datatables-boilerplate<filename>model/urls.py from django.contrib import admin from django.urls import path from .views import (RegionsJson, RegionsView) urlpatterns = [ path('RegionsJson/', RegionsJson.as_view(), name='RegionsJson'), path('regions/', RegionsView.as_view(), name='Regio...
StarcoderdataPython
8030074
<gh_stars>0 from abc import ABC, abstractmethod class Storage(ABC): @abstractmethod def __init__(self, config): pass @abstractmethod def get_cdn_url(self, path): pass @abstractmethod def exists(self, path): pass @abstractmethod def uploadf(self, file, key, **kwargs): pass def u...
StarcoderdataPython
3592727
<gh_stars>0 n=int(input()) t=1 for i in range(0,n): for j in range(0,i+1): print(t,end="") t=t+1 print("\r")
StarcoderdataPython
6430932
class Colors: HEADER = "\033[35m" OKBLUE = "\033[34m" OKGREEN = "\033[32m" WARNING = "\033[33m" FAIL = "\033[31m" ENDC = "\033[0m" BOLD = "\033[1m" UNDERLINE = "\033[4m"
StarcoderdataPython
3263984
<gh_stars>0 import numpy as np import torch from model.vcn import VCN class VCN_Wrapped(VCN): """L is previous frame, R is current frame, flow is L refference frame""" # check partial GRU implementation commit def __init__(self, size, md, fac, meanL, meanR): """ md - maximum disparity, f...
StarcoderdataPython
11223983
from time import sleep n1 = int(input('Digite o primeiro valor: ')) n2 = int(input('Digite o segundo valor: ')) opcao = 0 while opcao != 5: print(''' [ 1 ] SOMAR [ 2 ] MULTIPLICAR [ 3 ] MAIOR [ 4 ] NOVOS VALORES [ 5 ] SAIR''') opcao = int(input('>>>>> O que deseja fazer com os valores? ')) ...
StarcoderdataPython
59222
""" Module contenant les classes utiles à la modélisation sous forme de graphe : Sommet, Arc, Graphe auteur : cmarichal """ from typing import Tuple, List from math import floor import numpy as np from classes_traitement_plan import CouleurSpeciale, Plan class Sommet: """Sommet ayant une position et un numéro""...
StarcoderdataPython
3385084
<reponame>willcodefortea/wagtail<filename>wagtail/wagtailimages/admin_urls.py from django.conf.urls import url from wagtail.wagtailimages.views import images, chooser, multiple urlpatterns = [ url(r'^$', images.index, name='wagtailimages_index'), url(r'^(\d+)/$', images.edit, name='wagtailimages_edit_image')...
StarcoderdataPython
4937968
<filename>qutebrowser/quteconfig.py # Autogenerated config.py # Documentation: # qute://help/configuring.html # qute://help/settings.html # Uncomment this to still load settings configured via autoconfig.yml # config.load_autoconfig() # Load a restored tab as soon as it takes focus. # Type: Bool c.session.lazy_re...
StarcoderdataPython
4889081
############################################################### ####### PROCESSING OF TREES ################################### ############################################################### # structure of the tree: # 0: name, 1: parent, 2: tab of children, 3: length, 4: isdup, 5:species, 6:bootstrap , 7: bppnumber, ...
StarcoderdataPython
3227398
<filename>custom_components/tion/fan.py """ Fan controls for Tion breezers """ from __future__ import annotations import logging from datetime import timedelta from functools import cached_property from typing import Any from homeassistant.components.climate.const import PRESET_BOOST, PRESET_NONE from homeassistant.c...
StarcoderdataPython
5069088
<reponame>aminhp93/learning_python from django.db import models from django.urls import reverse # Create your models here. class Tag(models.Model): tag = models.SlugField(unique=True) created = models.DateTimeField(auto_now_add=True) def __str__(self): return self.tag def get_absolute_url(self): return rever...
StarcoderdataPython
9759306
<filename>misinformation/extractors/extract_article.py import datetime from contextlib import suppress import re from ReadabiliPy.readabilipy import simple_json_from_html_string from .extract_element import extract_element from .extract_datetime import extract_datetime_string def xpath_extract_spec(xpath_expression, ...
StarcoderdataPython
1805323
""" Arguments for configuration """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import six import argparse import io import sys import random import numpy as np import os import paddle import paddle.fluid as fluid def str2bool(v): """ String ...
StarcoderdataPython
1728031
first.loc['US':, ['tail_num', 'origin', 'dest']]
StarcoderdataPython
148804
<filename>cli/minitrino/cli.py #!usr/bin/env/python3 # -*- coding: utf-8 -*- import os import click from minitrino import settings from minitrino import components from pathlib import Path CONTEXT_SETTINGS = {"auto_envvar_prefix": "MINITRINO"} pass_environment = click.make_pass_decorator(components.Environment, en...
StarcoderdataPython
11338676
<gh_stars>1-10 import random import json class TextGenerator(object): """ Chainに基づいて文章を生成するクラスです。 Attributes ---------- chain : list マルコフ連鎖に用いるチェーンが格納された配列。 """ def __init__(self, chain_json_filepath): """ 初期化メソッド Parameters ---------- chain_json_filepath : str チェーンデータが書か...
StarcoderdataPython
1837333
# -*- coding: utf-8 -*- # # Copyright (c) 2013-2016 Online SAS and Contributors. All Rights Reserved. # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # Licensed under the BSD 2-Clause License (the "License"); you may not use this # file except in compliance with the License. You ...
StarcoderdataPython
12817774
<gh_stars>0 #!/usr/bin/env python from builtins import classmethod import pgzero from pgzero.screen import Screen from pgzero.loaders import ImageLoader, SoundLoader from pgzero.keyboard import Keyboard from pgzero.constants import mouse from pgzero.clock import clock from pgzero.actor import Actor from pgzero.rect im...
StarcoderdataPython
8146874
#!/usr/bin/env python2.7 import tweepy import time from tweepy.streaming import StreamListener from tweepy import OAuthHandler from tweepy import Stream import json from unidecode import unidecode from Adafruit_Thermal import * printer = Adafruit_Thermal("/dev/ttyAMA0", 9600, timeout=5) consumer_key = "YOUR KEY HE...
StarcoderdataPython
6644543
# Given a mixed array of number and string representations of integers, # add up the string integers and subtract this from the total of the non-string integers. # def div_con(x): # X = [] # Y = [] # sumX = 0 # sumY = 0 # for num in x: # if type(num) == int: # X.append(num) #...
StarcoderdataPython
1707178
print(()) print((1,)) print((1,2,3)) print(tuple()) print(tuple((1,))) print(tuple((1,2,3))) print(tuple([1,2,3]))
StarcoderdataPython
6503468
<gh_stars>1-10 """ For Django-Rest-Framework Serialization http://www.django-rest-framework.org/api-guide/serializers/ Serializers allow complex data (e.g. querysets and model instances) to be converted to native Python datatypes that can be easily rendered into JSON, XML or other types. Serializer...
StarcoderdataPython
1607803
# SPDX-License-Identifier: Apache-2.0 import json import os from ..case.test_case import TestCase from typing import List, Text, Optional DATA_DIR = os.path.join( os.path.dirname(os.path.realpath(os.path.dirname(__file__))), 'data') def load_model_tests( data_dir: Text = DATA_DIR, kind: Optional[Te...
StarcoderdataPython
252834
class VerifierError(Exception): pass class VerifierTranslatorError(Exception): pass __all__ = ["VerifierError", "VerifierTranslatorError"]
StarcoderdataPython
9602674
<gh_stars>1-10 # Copyright (c) 2019, NVIDIA CORPORATION. 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 requir...
StarcoderdataPython
6570847
<gh_stars>10-100 # # The MIT License (MIT) # # This file is part of RLScore # # Copyright (c) 2008 - 2016 <NAME>, <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...
StarcoderdataPython
6466283
class Apple(object): def JustAMethod(self, abc): self.unused = abc self.x = abc self.y = abc return self def SetX(a, x): a.unused = 0 a.x = x def SetY(a, y): a.y = y def Sum(a): return a.x + a.y a = Apple() SetX(a, 20) SetY(a, 3) assert 23 == Sum(a) print Sum(...
StarcoderdataPython
8081998
from eth_wallet.cli.eth_wallet_cli import( eth_wallet_cli, ) from click.testing import( CliRunner, ) def call_eth_wallet(fnc=None, parameters=None, envs=None): """ Creates testing environment for cli application :param fnc: command to run :param parameters: program cmd argument :param envs...
StarcoderdataPython
8042579
<reponame>ttung/starfish import os import starfish from starfish.image import ApplyTransform, Filter, LearnTransform, Segmentation from starfish.spots import SpotFinder, TargetAssignment from starfish.types import Axes test = os.getenv("TESTING") is not None def iss_pipeline(fov, codebook): primary_image = fov....
StarcoderdataPython
6693543
<gh_stars>1-10 import torch from .jacobian import jacobian_backward, jacobian_norm, jacobian import numpy as np import pytest def test_jacobian_backward(): """Test the jacobian backprop function for a linear system y = A x For a linear system the gradient of Frobenious norm of the jacobian should be...
StarcoderdataPython
3364846
''' Functional tests for cassandra timeseries ''' import time import datetime import os import cql from . import helpers from .helpers import unittest, os, Timeseries @unittest.skipUnless( os.environ.get('TEST_CASSANDRA','true').lower()=='true', 'skipping cassandra' ) class CassandraApiTest(helpers.ApiHelper): de...
StarcoderdataPython
367992
import os import torch from torch.autograd import Variable from torch import optim import torch.nn.functional as F import torch.nn as nn import argparse import models import math parser = argparse.ArgumentParser(description='sample.py') parser.add_argument('-init', default='The meaning of life is ', ...
StarcoderdataPython
228948
import meshed as ms import pytest @pytest.fixture def simple_graph(): return dict(a='c', b='cd', c='abd', e='') def test_edge_reversed_graph(simple_graph): g = simple_graph assert ms.makers.edge_reversed_graph(g) == { 'c': ['a', 'b'], 'd': ['b', 'c'], 'a': ['c'], 'b': ['c...
StarcoderdataPython
3563567
#Definition of the Workload: https://dumps.wikimedia.org/other/pagecounts-raw/ # import locale locale.getdefaultlocale() from datetime import datetime, date, time import pandas as pd import calendar class RequestSummary: def __init__(self, project, titlePage, numberRequests, sizeContentBytes, year, month, day, hou...
StarcoderdataPython
5109635
import os import sys import unittest import django def runtests(): os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.test_settings' django.setup() setup_file = sys.modules['__main__'].__file__ setup_dir = os.path.abspath(os.path.dirname(setup_file)) return unittest.defaultTestLoader.discover(setup_di...
StarcoderdataPython
9778591
# Copyright 2017 Google Inc. 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 required by applicable law or a...
StarcoderdataPython
4890741
from flask import Flask from flask import render_template from flask import url_for from flask import request from flask import redirect from flask import session from flask_bootstrap import Bootstrap import sqlite3 as sql app = Flask(__name__) # Creates the secret key, should be more secure in production. app.sec...
StarcoderdataPython
3272565
import logging from test.rules.inspect.utils import cache_nlp, dep_list, if_inside from test.rules.utils.load_dataset import load_dataset from src.utils.spacy import get_spacy logger = logging.getLogger(__name__) if __name__ == "__main__": data = list(load_dataset("pretrained_data/task_core_aux_cond/all.jsonl")...
StarcoderdataPython
5146231
import numpy as np import pandas as pd from tqdm import tqdm as tqdm import torch from core.data.utils import AdversarialDatasetWithPerturbation device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') def get_orthogonal_vector(r): """ Returns a random unit vector orthogonal to given unit vec...
StarcoderdataPython
3426109
<reponame>jpypi/dup-image-search #!/usr/bin/python """ find_all_image_duplicates.py Given an input of hashes and corresponding filenames, generates 2 files: exact_duplicates.txt - contains the listing of image filenames that are duplicates and what they are duplicates of corrupt_image...
StarcoderdataPython
387976
import numpy as np from os import listdir from os.path import isfile, join, dirname from scipy.io import loadmat meta_clsloc_file = join(dirname(__file__), "data", "meta_clsloc.mat") synsets = loadmat(meta_clsloc_file)["synsets"][0] synsets_imagenet_sorted = sorted([(int(s[0]), str(s[1][0])) for s in synsets[:1...
StarcoderdataPython
196323
import requests from allauth.socialaccount import app_settings from allauth.socialaccount.providers.oauth2_provider.client import ( OAuth2Client, OAuth2Error, ) from .provider import UntappdProvider class UntappdOAuth2Client(OAuth2Client): """ Custom client because Untappd: * uses redirect_u...
StarcoderdataPython
384925
<gh_stars>0 """ Python pickle and jsonpickle demo object serialization Serialize an object, save it to a file and use it later on the state that it was pickled. AUTHOR <NAME> DATE 17/01/2020 # refactor1 to generate a two teams game and play inning by inning # refactor2 keep the score # refactor3...
StarcoderdataPython
8029490
<filename>tests/demos/demo_URL_recognition.py # # -*- coding:utf-8 -*- # Author:wancong # Date: 2018-04-30 from pyhanlp import * def demo_URL_recognition(text): """ 演示URL识别 >>> text = '''HanLP的项目地址是https://github.com/hankcs/HanLP, ... 发布地址是https://github.com/hankcs/HanLP/releases, ... 我有时候会在www.hankc...
StarcoderdataPython
5139123
<reponame>jicewarwick/DingTalkMessageBot<filename>DingTalkMessageBot.py import base64 import hashlib import hmac import json import time import urllib.parse import requests class DingTalkMessageBot(object): msg_template = { "msgtype": "text", "text": { "content": "" } } ...
StarcoderdataPython
209130
<gh_stars>1-10 """Tests numerical inverse kinematics pipeline. """ import math import unittest import random from colony_picker.inverse_kinematics import* from tests.helper_functions_for_tests import* from colony_picker.dh_params import AR3_DH_PARAMS, AR3_NUM_JOINTS animation_test_warning = "Only one animation test sh...
StarcoderdataPython
12845700
<filename>jit_compiling/test.py import torch from torch.utils.cpp_extension import load norm = load(name="two_norm", sources=["two_norm/two_norm_bind.cpp", "two_norm/two_norm_kernel.cu"], verbose=True) n,m = 8,3 a = torch.randn(n,m) b = torch.randn(n,m) c = torch.zeros(1) print(...
StarcoderdataPython
5049265
#! /bin/env python import sys, os import yaml # set up PYTHONPATH path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) libpath = path sys.path.append(libpath) import mcb from mcb.config import Config from mcb.runner import Runner from mcb.frontends.cli import getCliRunner config = mcb.config.Config()...
StarcoderdataPython
6417187
#!/usr/bin/env python # encoding: utf-8 import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config(object): """Base Configuration""" SECRET_KEY = os.environ.get('SECRET_KEY') or '<PASSWORD>' # Modify your SECRET KEY 建议足够复杂 TITLE = 'PersonalResume' # 简历标题,例:马云的简历 SUB_TITLE = '好的东...
StarcoderdataPython
9638950
<gh_stars>0 # Clases base class BaseCompute: def __init__(self, driver): self.driver = driver def create_vm(self, name=None, image_id=None, size_id=None, subnet=None, add_public_ip=True): """ :param name: String with a name for this new node :type name: ``str`` :...
StarcoderdataPython
3554092
#!/usr/bin/env python """ Created by howie.hu at 30/03/2018. """ import time from pprint import pprint from talospider import Spider, Item, TextField, AttrField from talospider.utils import get_random_user_agent from owllook.database.mongodb import PyMongoDb, MotorBase from owllook.utils.tools import async_callback...
StarcoderdataPython
1639889
import remoto import json import ceph_medic from ceph_medic import terminal def get_mon_report(conn): command = [ 'ceph', '--cluster=%s' % ceph_medic.metadata['cluster_name'], 'report' ] out, err, code = remoto.process.check( conn, command ) if code > 0: ...
StarcoderdataPython
9719786
# coding=utf-8 """ Dummy package that holds templates for code injection """
StarcoderdataPython
1997270
############################################################################### # RobustScaler import numpy from nimbusml import FileDataStream from nimbusml.datasets import get_dataset from nimbusml.preprocessing.normalization import RobustScaler # data input (as a FileDataStream) path = get_dataset('infert').as_file...
StarcoderdataPython
11236574
# encoding: utf-8 """ @author: xyliao @contact: <EMAIL> """ from copy import deepcopy import numpy as np import torch from mxtorch import meter from mxtorch.trainer import Trainer, ScheduledOptim from torch import nn from torch.autograd import Variable from torch.utils.data import DataLoader from tqdm import tqdm imp...
StarcoderdataPython
1897531
from __future__ import annotations from abc import ABCMeta, abstractmethod from typing import TYPE_CHECKING, Dict, Optional from lander.ext.parser._cidata import CiMetadata from lander.ext.parser._datamodel import DocumentMetadata from lander.ext.parser._gitdata import GitRepository from lander.ext.parser.texutils.ex...
StarcoderdataPython
12800598
# -*- coding: utf-8 -*- # vim:fileencoding=utf-8 ai ts=4 sts=4 et sw=4 """Tests for wafer.user.models""" from django.test import TestCase from wafer.tests.utils import create_user class UserModelTestCase(TestCase): def test_str_method_issue192(self): """Test that str(user) works correctly""" use...
StarcoderdataPython
197004
import requests from bs4 import BeutifulSuop import urllib.request link = "" ptc = requests.get(link) html = ptc.content sp = BeutifulSuop(html, "html.parser") for img in sp.find_all('img'): print(img.get("src")) ''' https://cidades.ibge.gov.br/brasil/rn/natal/panorama ''' ''' print(ptc) tempo de resposta prin...
StarcoderdataPython
5014556
<reponame>OgiBalboa/E-Book_Cryptology<filename>main.py """ Bu uygulama Marmara Üniversitesi Teknoloji Fakültesi Mekatronik Mühendisliği Bölümü için geliştirilmiştir. E-book kitapları için şifreleme sistemidir. @yazar: ogibalboa Tarih : 05.06.2020 """ import sys sys.path.append("bin") from PyQt5 import QtCore, Q...
StarcoderdataPython
6655073
<gh_stars>0 # Generated by Django 2.1.2 on 2018-11-29 18:39 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('students', '0002_student_classes'), ] operations = [ migrations.AddField( model_name='student', name='ty...
StarcoderdataPython
1903485
<reponame>frsierrag/accesoriesStoreApp<filename>blog/migrations/versions/d5fdc4591e9e_modelo_usuario.py """modelo usuario Revision ID: d5fdc4591e9e Revises: Create Date: 2020-12-12 21:25:31.881940 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '<PASSWORD>' do...
StarcoderdataPython
8085250
from blaze.expr import * from blaze.expr.split import * from blaze.api.dplyr import transform import datashape from datashape import dshape from datashape.predicates import isscalar t = TableSymbol('t', '{name: string, amount: int, id: int}') a = Symbol('a', '1000 * 2000 * {x: float32, y: float32}') def test_path_sp...
StarcoderdataPython
9735083
from models import Duck, Pink from core.auth import authentication, authorization, check_scopes from core.base import BaseMgr from core.errors import InvalidCredential, RecordNotFound from core.singleton import db, pat, redis, sendgrid from core.utils import FromConf, random_b85 class PinkMgr(BaseMgr): model = Pi...
StarcoderdataPython
4832096
from rest_framework import serializers from . import models as services_models class ServiceAgentSerializer(serializers.ModelSerializer): owner = serializers.HyperlinkedRelatedField( many=False, read_only=True, view_name='users:service_bus_details', ) class Meta: model = services_models...
StarcoderdataPython
3221157
max_1 = 1000 max_2 = 1000 max_3 = 1000 with open('res.txt','r') as file: for line in file.readlines(): t = line.split(';') if float(t[2].replace("\n","")) < max_3: max_1 = float(t[0]) max_2 = float(t[1]) max_3 = float(t[2].replace("\n","")) print(max_1,max_2,max...
StarcoderdataPython
37552
<gh_stars>1-10 import numpy as np import matplotlib.pyplot as plt from tqdm import trange from htm.bindings.sdr import SDR from htm.bindings.algorithms import TemporalMemory from htm.bindings.algorithms import SpatialPooler from itertools import product from copy import deepcopy import json EPS = 1e-12 class Memory:...
StarcoderdataPython
11204918
<gh_stars>1-10 """ Test reload for trained models. """ import os import pytest import unittest import tempfile import numpy as np import deepchem as dc import tensorflow as tf import scipy from flaky import flaky from sklearn.ensemble import RandomForestClassifier from deepchem.molnet.load_function.chembl25_datasets im...
StarcoderdataPython
4869997
#!/usr/bin/env python3 #coding: utf-8 ### 1st line allows to execute this script by typing only its name in terminal, with no need to precede it with the python command ### 2nd line declaring source code charset should be not necessary but for exemple pydoc request it __doc__ = "this module allow to check and get in...
StarcoderdataPython
152150
import databricks.koalas as ks import pandas as pd import pytest from pandas.testing import assert_frame_equal, assert_series_equal from gators.converter.koalas_to_pandas import KoalasToPandas ks.set_option("compute.default_index_type", "distributed-sequence") @pytest.fixture def data_ks(): X = ks.DataFrame( ...
StarcoderdataPython
9632480
"""Extract minimal growth media and growth rates.""" import pandas as pd from micom import load_pickle from micom.media import minimal_medium from micom.workflows import workflow max_procs = 6 processes = [] def media_and_gcs(sam): com = load_pickle("models/" + sam + ".pickle") # Get growth rates sol ...
StarcoderdataPython
3520797
""" In charge of evolving a population for the set number of mating events. """ import sys from kaplan.ga_input import read_ga_input, verify_ga_input from kaplan.mol_input import read_mol_input, verify_mol_input from kaplan.ring import Ring, RingEmptyError from kaplan.tournament import run_tournament from kaplan.ou...
StarcoderdataPython
128598
<gh_stars>1-10 """ mem_fifo.py ============================================================================ Create a queue/storage for small amounts of data inside a given memory pool. """ import uctypes import sys # from uasyncio.queues import QueueFull, QueueEmpty FIFO_HEADER = { "magic": 0 | uctypes.UINT...
StarcoderdataPython
9624023
/anaconda/lib/python3.6/base64.py
StarcoderdataPython
6654684
<filename>test/programytest/storage/stores/file/store/test_patternnodes.py import os import os.path import unittest from programy.parser.pattern.factory import PatternNodeFactory from programy.storage.stores.file.config import FileStorageConfiguration from programy.storage.stores.file.config import FileStoreConfigurat...
StarcoderdataPython
6566439
<filename>ja_tableau/test_tableau.py import ja_language as ja_lan import pandas as pd if __name__ == "__main__": # Inital JA Language Agent ja_lan = ja_lan.language_translator() try: ja_lan_df = pd.read_pickle('ja_lan_env.pkl') apply_lan = ja_lan_df['ja_lan'][0] ja_lan.set_lang...
StarcoderdataPython
9651598
<filename>appengine/src/greenday_api/user/messages.py """ Protorpc messages for the user API """ from protorpc import messages, message_types from django.contrib.auth import get_user_model from django_protorpc import DjangoProtoRPCMessage class UserRequestMessage(DjangoProtoRPCMessage): """ ProtoRPC...
StarcoderdataPython
3498267
<filename>examples/DataAnalysis/CentralBase.py # encoding: UTF-8 import sys import json from pymongo import MongoClient from vnpy.trader.app.ctaStrategy.ctaBase import DATABASE_NAMES import pandas as pd import numpy as np import datetime as dt import talib as ta from interval import Interval import time #方向 M...
StarcoderdataPython
57906
<gh_stars>1-10 import numpy as np import pandas as pd import os import sys """ Storey Q-Values - https://github.com/StoreyLab/qvalue -------------------- Python Wrapper Author: <NAME> https://github.com/broadinstitute/tensorqtl/blob/master/tensorqtl/rfunc.py """ def qvalue(p, lambda_qvalue=None): """Wrapper for qv...
StarcoderdataPython
1888135
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
StarcoderdataPython
6421108
from x64dbg import * def main(): start, end = Gui.SelectionGet(Gui.Window.DisassemblyWindow) print("Disassembly Window: 0x%X - 0x%X" % (start, end)) start, end = Gui.Disassembly.SelectionGet() print("Disassembly Window: 0x%X - 0x%X" % (start, end)) start, end = Gui.Dump.SelectionGet() ...
StarcoderdataPython
3292300
<reponame>CrazyDi/Python1 import asyncio async def handle_echo(reader, writer): data = await reader.read(1024) message = data.decode() addr = writer.get_extra_info("peername") print("received %r from %r" % (message, addr)) # writer.close() if __name__ == "__main__": loop = asyncio.new_event_l...
StarcoderdataPython
3344107
#!/bin/python3.4 #Django #author: <NAME> # from django.contrib import admin from .models import Post admin.site.register(Post)
StarcoderdataPython
92800
from django import forms from .utils import get_coins_list class ChooseCoinToPayForm(forms.Form): currency = forms.ChoiceField(choices=get_coins_list(), widget=forms.RadioSelect(), label='', required=True)
StarcoderdataPython
97577
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import queue import threading import subprocess import datetime import time import codecs # weather 天気予報 import speech_api_weather as weather_api import speech_api_weather_key as weather_key qPathTTS = 'temp/a3_5tts_txt/' qPathWork = 'temp...
StarcoderdataPython
158533
<filename>exceltogdx/exceltogdx.py from gdxpds import load_gdxcc from gdxpds.write_gdx import Translator from openpyxl import load_workbook from io import BytesIO import pandas as pd import numpy as np import logging import os import re logging.getLogger('gdxpds').setLevel(logging.ERROR) def xlsdynamicecke(typ, cell,...
StarcoderdataPython
9799148
<filename>utils/data/samplers/range_sampler.py import torch from torch.utils.data.sampler import Sampler class RangeSampler(Sampler): def __init__(self, start_ind, end_ind): self.start_ind = start_ind self.end_ind = end_ind def __iter__(self): indices = torch.arange(self.sta...
StarcoderdataPython
6684245
# -*- coding: utf-8 -*- """ タマリンコネクタにおけるデータモデルのシリアライザ. @author: <EMAIL> """ from rest_framework import serializers from . import models class UserSerializer(serializers.ModelSerializer): """[Userモデルのシリアライザ]""" class Meta: model = models.User fields = ["id", "username", "date_upd...
StarcoderdataPython
70347
""" The ``cpp_pimpl`` test project. """ from testing.hierarchies import clike, directory, file, namespace def default_class_hierarchy_dict(): """Return the default class hierarchy dictionary.""" return { namespace("pimpl"): { clike("class", "Planet"): {}, clike("class", "Earth...
StarcoderdataPython
3531623
from graph import * filename = input() G = Graph(filename) dist_arrays = [] n_max = 0 for i in range (G.n_vertices): dist_arrays.append(G.dijkstra(i)) for j in range(len(dist_arrays[i])): if n_max < len(str(dist_arrays[i][j])): n_max = len(str(dist_arrays[i][j])) for i in range (len(dist_...
StarcoderdataPython
296225
<gh_stars>1-10 ''' Includes: * Function to compute the IoU, and ARIou180, similarity for rectangular, 2D bounding boxes * Function for coordinate conversion for rectangular, 2D bounding boxes Copyright (C) 2018 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in ...
StarcoderdataPython
281084
from toontown.hood import HoodAI from toontown.safezone import DistributedTrolleyAI from toontown.safezone import DistributedMMPianoAI from toontown.toonbase import ToontownGlobals from toontown.ai import DistributedEffectMgrAI class MMHoodAI(HoodAI.HoodAI): def __init__(self, air): HoodAI.HoodAI.__init__(...
StarcoderdataPython
5058321
from abc import ABCMeta, abstractmethod from logging import getLogger from typing import Callable, Dict, List import numpy as np logger = getLogger(__name__) class RuntimeModuleBase(metaclass=ABCMeta): """Base class of runtime module. RuntimeModule wraps the runtime of the model framework. """ @ab...
StarcoderdataPython