id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
12834676
<gh_stars>0 from model.project import Project class ProjectHelper: def __init__(self, app): self.app = app def open_project_page(self): wd = self.app.wd if not (wd.current_url.endswith("/manage_proj_create_page.php")): wd.find_element_by_xpath("//div[@id='main-container']/d...
StarcoderdataPython
1919637
<filename>main.py import argparse from scraper import Scraper from common import init_config, TRY_AGAIN_STR from extractor import Extractor from formatter import Formatter from saver import ContentSaver """ Short algo: 0st - initialize config 1st - get html with scrapper 2nd - clear tags and so ...
StarcoderdataPython
6614268
import requests from bs4 import BeautifulSoup def make_synonym_dict(word): #word = input() synonym_dict={word:[]} url = "https://thesaurus.weblio.jp/content/" + word #headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Sa...
StarcoderdataPython
6416405
import numpy as np x = np.array([ [19, 9], [15, 7], [7, 2], [17, 6] ]) y = np.array([1, 1, 2, 2]) x1 = np.array([ x[0], x[1], x[2], x[3], ]) x2 = np.array([ x[1], x[0], x[3], x[2], ]) x1x2 = x1 - x2 normx1x2 = np.linalg.norm(x1x2, axis=1) print('x1x2\n%s\nnormx1x2\n%s\...
StarcoderdataPython
12852260
<filename>dictionary_service.py #!/usr/bin/python3 import argparse import logging as log from aiohttp import web from api.databasemanager import DictionaryDatabaseManager from api.dictionary import \ entry, \ definition, \ translation, \ configuration from api.dictionary import \ get_dictionary, \...
StarcoderdataPython
9723997
<reponame>aelamspychron/pychron<gh_stars>1-10 # =============================================================================== # Copyright 2011 <NAME> # # 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 Li...
StarcoderdataPython
6646739
<reponame>lordvinick/Python print('='*12, 'Custo da Viagem', '='*12) distancia = float(input('Qual é a distância da viagem? ')) print(f'Você está prestes a começar uma viagem de {distancia}Km') if distancia <= 200: print('E o preço da sua passagem será de R${:.2f}'.format(distancia * 0.50)) else: print(f'E o pr...
StarcoderdataPython
8191664
<gh_stars>0 from tkinter import * #importando tkinter import tkinter as TK import gramatica as g import gramaticaF2 as g2 import Utils.TablaSimbolos as table import Utils.Lista as l import Librerias.storageManager.jsonMode as storage from tkinter.filedialog import askopenfilename as files import os import webbrowser ...
StarcoderdataPython
11237449
import utils TEST_INPUT = (0, 3, 0, 1, -3) def increment_jumps(jump): return jump + 1 def decrement_large_jumps(jump): if jump >= 3: return jump - 1 return jump + 1 def steps_til_exit(data, jump_modifier=increment_jumps): data = list(data) size = len(data) position = 0 total_...
StarcoderdataPython
1915612
<filename>scripts/traffic_sign_classifier.py<gh_stars>0 import pickle import numpy as np import matplotlib.pyplot as plt import classifier_util as util from sklearn.utils import shuffle import tensorflow as tf import lenet as lenet dataset_dir = '../dataset' training_file = dataset_dir + '/train.p' validation_file = ...
StarcoderdataPython
136458
<filename>vCenterShell/commands/connect_dvswitch.py from models.ConnectionResult import ConnectionResult from common.utilites.common_utils import get_object_as_string class VirtualSwitchConnectCommand: def __init__(self, pv_service, virtual_switch_to_machine_connector, ...
StarcoderdataPython
162649
class DiseaseError(Exception): "Base class for disease module exceptions." pass class ParserError(DiseaseError): pass
StarcoderdataPython
8122209
<gh_stars>0 #coding=utf-8 ''' path = ./mypackage/subB/brust.py filename = brust.py ''' rust = 'RUST' print('in mypackage/subB/brust.py :',rust)
StarcoderdataPython
1981208
<reponame>this-josh/felling<gh_stars>1-10 from setuptools import setup, find_packages project_urls = { "Source": "https://github.com/this-josh/felling", "Tracker": "https://github.com/this-josh/felling/issues", } with open("README.md", "r", encoding="utf-8") as f: long_description = f.read() classifiers ...
StarcoderdataPython
6515836
<filename>src/hardware_indep/dataplane_smem.c.py<gh_stars>10-100 # SPDX-License-Identifier: Apache-2.0 # Copyright 2016 Eotvos Lorand University, Budapest, Hungary from utils.codegen import format_declaration, format_statement, format_expr, format_type, gen_format_type, get_method_call_env from compiler_log_warnings_e...
StarcoderdataPython
9720956
# coding: utf-8 # # Copyright 2021 The Oppia 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 requi...
StarcoderdataPython
9711989
<filename>examples/meowbit/test_bmp.py import pyb import framebuf import image fbuf = bytearray(160*128*2) tft = pyb.SCREEN() fb = framebuf.FrameBuffer(fbuf, 160, 128, framebuf.RGB565, 160) img = image.Image(fb) img.loadbmp("images/test24.bmp") tft.show(fb)
StarcoderdataPython
9604664
<reponame>laurenmm/simmate-1 # -*- coding: utf-8 -*- from simmate.calculators.vasp.tasks.relaxation.quality_04 import Quality04Relaxation class Quality04Energy(Quality04Relaxation): """ Runs a rough VASP static energy calculation. `Quality 04` relates to our ranking of relaxation qualities, where this ...
StarcoderdataPython
4837919
<gh_stars>0 from random import choice # Variáveis com códigos de cores! vermelho, amarelo, azul1, lilas, azul, fim = '\033[1:31m', '\033[1:33m', '\033[1:34m', '\033[1:35m', \ '\033[1:36m', '\033[m' # Cabeçalho print(vermelho, '-=-' * 16, fim) print(azul, 'ADVINHE O NÚMERO QU...
StarcoderdataPython
5117400
<filename>L1Trigger/L1THGCalUtilities/python/clustering3d.py import FWCore.ParameterSet.Config as cms from L1Trigger.L1THGCal.customClustering import binSums, dr_layerbylayer def create_distance(process, inputs, distance=0.01 ): producer = process.hgcalBackEndLayer2Producer.clone() producer....
StarcoderdataPython
3205071
from django.shortcuts import render from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import permissions, status from .models import FibResItem from .serializers import FibReqItemSerializer, FibResItemSerializer # MQTT import paho.mqtt.client as mqtt # rgpc imp...
StarcoderdataPython
6529093
from __future__ import print_function from .sqlschema import SQLSchema, SQLResultSet import sqlite3 import os from datetime import datetime import traceback, sys show_track = 0 class DebugConnection(sqlite3.Connection): def commit(self): if show_track and 0: print('============== commit', file=sys.stderr) ...
StarcoderdataPython
108465
<gh_stars>0 # -*- coding: utf-8 -*- # # Copyright © 2012 CEA # <NAME> # Licensed under the terms of the CECILL License # (see guiqwt/__init__.py for details) """Flip/rotate test""" SHOW = True # Show test in GUI-based test launcher from guiqwt.widgets.fliprotate import FlipRotateDialog, FlipRotateWidget from guiqwt....
StarcoderdataPython
1607675
import os import re import argparse import csv import subprocess from datetime import date import math # ############################################################### # Class for parsing VTR results for various experiments # ############################################################### class GenResults(): #-----...
StarcoderdataPython
11312849
<filename>tests/test_robot.py #!/usr/bin/env python # -*- coding:utf-8 -*- # Author: kakakaya, Date: Thu Dec 15 13:14:32 2016 # from pprint import pprint as p from unittest import TestCase from nose.tools import ok_, eq_, raises from boppy import robot from boppy.adapter.stdio import StdinInput, StdoutOutput class Te...
StarcoderdataPython
3213755
#!/usr/bin/env python3 # coding = utf-8 import os import unittest as ut import numpy as np from mykit.core.utils import get_matched_files from mykit.vasp.xml import Vasprunxml, VasprunxmlError class test_vasprunxml_read(ut.TestCase): def test_scf_xml(self): '''Test reading XMLs for SCF calculations (L...
StarcoderdataPython
5077211
<reponame>DmPo/Schemaorg_CivicOS import os import unittest from support import html5lib_test_files, TestData, test_dir from html5lib import HTMLParser, inputstream import re, unittest class Html5EncodingTestCase(unittest.TestCase): def test_codec_name(self): self.assertEquals(inputstream.codecName("utf-8...
StarcoderdataPython
5112561
<reponame>dfki-asr/MMIPython-Core<gh_stars>0 ## SPDX-License-Identifier: MIT ## The content of this file has been developed in the context of the MOSIM research project. ## Original author(s): <NAME>, <NAME> from MOSIM.core.utils.thrift_client import ThriftClient from MOSIM.mmi.services import MSkeletonAccess def in...
StarcoderdataPython
6410222
<reponame>tschalch/pyTray #Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/enums.py __version__=''' $Id: enums.py,v 1.1 2006/05/26 19:19:44 thomas Exp $ ''' __doc__=""" holder for all reportl...
StarcoderdataPython
4986660
import re from typing import Dict, List, Optional, cast import requests from faaspact_verifier import abc from faaspact_verifier.definitions import Pact, VerificationResult from faaspact_verifier.exceptions import PactBrokerError class PactBrokerGateway(abc.PactBrokerGateway): """Gateway to a pact broker.""" ...
StarcoderdataPython
120939
<reponame>zqngetsu96/PyForex import pandas as pd import numpy as np from scipy.signal import argrelextrema def peak_detect(price): # Find our relative extrema # Return the max indexes of the extrema max_idx = list(argrelextrema(price, np.greater, order=3)[0]) # Return the min indexes of the extrema ...
StarcoderdataPython
4923069
"""bookr URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based v...
StarcoderdataPython
5196259
from typing import List from chaoslib.discovery.discover import (discover_probes, discover_actions, initialize_discovery_result) from chaoslib.types import DiscoveredActivities, Discovery from logzero import logger __version__ = '1.0.6-dev0' def discover(discover_system: boo...
StarcoderdataPython
1749828
<gh_stars>1-10 from dagster import job # This job will run with multiprocessing execution @job def do_it_all(): ... # This job will run with in-process execution @job(config={"execution": {"config": {"in_process": {}}}}) def do_it_all_in_proc(): ...
StarcoderdataPython
7963
<reponame>grace1307/lan_mapper<filename>app/services/base.py from app.db import db # Ignore it if db can't find the row when updating/deleting # Todo: not ignore it, raise some error, remove checkers in view class BaseService: __abstract__ = True model = None # Create def add_one(self, **kwargs): ...
StarcoderdataPython
243306
<reponame>tris10au/sshclip from sshclip import devices import pyperclip import click import time def get_last_modified_time(device, clip_path): try: return device.stat(clip_path).st_mtime except FileNotFoundError: return None def run_sshclip(device, clip_path=None, verbose=False, delay=1): ...
StarcoderdataPython
11224036
<reponame>jialin-wu-02/skyportal<filename>skyportal/handlers/api/filter.py from marshmallow.exceptions import ValidationError from baselayer.app.access import auth_or_token, permissions from ..base import BaseHandler from ...models import ( DBSession, Filter, ) class FilterHandler(BaseHandler): @auth_or_...
StarcoderdataPython
3532562
<reponame>Pixep/qml-files-combiner import os print "-----" os.system("python combine-qml.py --help") print "-----" os.system("python combine-qml.py -v tests/main-base.qml tests/main.qml -c tests/Button.qml Button")
StarcoderdataPython
3358063
# -*- coding: utf-8 -*- """ Created in Aug 2016 @author: <NAME> (ComplexCity, EIVP, KTH) """ # # This script investigates the surrounding built environment of flickr photo locations thanks to 13 precise queries. # It was implemented in order to build a statistic model to describe stress feeling and link it with the b...
StarcoderdataPython
4916757
# 547 朋友圈 class Solution: def findCircleNum(self, M: List[List[int]]) -> int: if not M: return 0 n=len(M) p=[i for i in range(n)] for i in range(n): for j in range(n): if M[i][j]==1: self._union(p,i,j) return len(set([self._par...
StarcoderdataPython
3495051
<filename>adminmgr/media/code/python/red1/reducer.py<gh_stars>1-10 #!/usr/bin/python3 from operator import itemgetter import sys import csv import ast Dict={} for line in sys.stdin: lst = ast.literal_eval(line) tupple = (lst[0],lst[1]) if(tupple not in Dict): Dict[tupple] = [lst[2],lst[3]] else: Dict[tupp...
StarcoderdataPython
5007097
from uuid import uuid4 from blockchain import Blockchain from utility.verification import Verification from wallet import Wallet class Node: def __init__(self): # self.wallet.public_key = str(uuid4()) self.wallet = Wallet() self.wallet.create_keys() self.blockchain = Blockchain...
StarcoderdataPython
8147134
def fu<the_ref>nc(**args): """ Keyword args: foo: bar baz Keyword arguments: quux """
StarcoderdataPython
4913156
""" Color Encoder Module Description ================== The file color_map.png contains color-coded state regions. This module encodes those colors in RGB form into a corresponding state abbrevation. Copyright Information =============================== This file is Copyright (c) 2021 <NAME>, <NAME>, <NAME>, <NAME>. ...
StarcoderdataPython
1728333
# Generated by Django 3.0.6 on 2020-05-19 18:16 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0003_waitlist_confirmed'), ] operations = [ migrations.AddField( model_name='waitlist', name='from_email', ...
StarcoderdataPython
6519921
#!/usr/bin/python # -*- coding: utf-8 -*- # make it possible to run as standalone program from __future__ import print_function import sys import string import re sys.path.append('/srv/chemminetools') from django.core.management import setup_environ import chemminetools.settings setup_environ(chemminetools.settings) f...
StarcoderdataPython
12864422
from __future__ import annotations import operator from enum import Enum from itertools import product from typing import Dict, Union import numpy as np class Operation(Enum): PLUS = 'PLUS' MINUS = 'MINUS' TIMES = 'TIMES' EXP = 'EXP' MAX = 'MAX' MIN = 'MIN' CONT = 'CONT' NOT = 'NOT' ...
StarcoderdataPython
6620493
<reponame>A-Ortiz-L/hyperspectral-imaging-cnn-final-degree-work from google.cloud import storage from google.cloud.exceptions import NotFound from logging import getLogger log = getLogger(__name__) class GoogleStorage: def __init__(self): self.client = storage.Client() self.storage_list = {} ...
StarcoderdataPython
256966
<gh_stars>10-100 import os import tempfile import pytest FIXTURES_ROOT = os.path.join(os.path.dirname(__file__), "fixtures") @pytest.fixture() def fixture_file(): return lambda name: os.path.join(FIXTURES_ROOT, name) @pytest.fixture(scope="session") def image_diff_reference_dir(): return os.path.join(os.p...
StarcoderdataPython
12808159
<reponame>Amplo-GmbH/AutoML<filename>tests/unit/api/__init__.py import pytest from pathlib import Path from tests import rmtree __all__ = ['TestAPI'] class TestAPI: sync_dir = Path('./test_dir') @pytest.fixture(autouse=True) def rmtree_sync_dir(self): rmtree(self.sync_dir) yield ...
StarcoderdataPython
1627057
from __future__ import print_function import os, os.path, shutil, re, glob import platform as plat import subprocess as sp import Tkinter as tk import tkSimpleDialog as tkSD import tkMessageBox as tkMB import tkFont import ttk # General GENIE utilities. import utils as U # Most of the GUI code is in these modules... ...
StarcoderdataPython
8164255
<reponame>mapsme/mwm.py<filename>setup.py from setuptools import setup from os import path from mwm import __version__ here = path.abspath(path.dirname(__file__)) setup( name='mwm', version=__version__, author='<NAME>', author_email='<EMAIL>', packages=['mwm'], package_data={'mwm': ['types.txt...
StarcoderdataPython
1820732
from __future__ import print_function from __future__ import division from __future__ import unicode_literals import numpy as np np.random.seed(123) import tensorflow as tf tf.set_random_seed(123) import deepchem as dc # Load Tox21 dataset tasks, datasets, transformers = dc.molnet.load_qm7b_from_mat() train_dataset, ...
StarcoderdataPython
363927
# Copyright 2017 <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, publish, distribute, su...
StarcoderdataPython
6679978
import unittest from gemstones import * class TestCommonGems(unittest.TestCase): def test_given(self): self.assertEqual(2, common_gems(['abcdde', 'baccd', 'eeabg'])) if __name__ == '__main__': unittest.main()
StarcoderdataPython
6409197
"""Connect to a remote Tamr when SSH is proxied via OKTA Advanced Server Access""" import paramiko import os import subprocess import tamr_toolbox as tbox # Set your connection parameters hostname = "10.99.9.999" username = "my.username" # Login to Okta ASA. # If there is no current session a browser window will ope...
StarcoderdataPython
4847018
<reponame>hvy/pfi-internship2016<filename>assignment4_adagrad.py<gh_stars>1-10 import math import time from utils import dataset, randomizer, exporter from assignment3 import optimize_sgd from assignment4 import Autoencoder class AutoencoderAdaGrad(Autoencoder): """Simple Autoencoder implementation with one hidde...
StarcoderdataPython
4844042
<gh_stars>0 #Pop the last item of the list below. lst=[11, 100, 99, 1000, 999] #Type your answer here. popped_item=lst.pop(len(lst)-1) print(popped_item) print(lst) #======================= #Remove "broccoli" from the list using .pop and .index methods. lst=["milk", "banana", "eggs", "bread", "broccoli", "lemons...
StarcoderdataPython
9601250
<reponame>tsuru/varnishapi # Copyright 2014 varnishapi authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. import codecs import httplib2 import os import varnish from feaas import storage VCL_TEMPLATE_FILE = os.path.abspath(os.path.join(...
StarcoderdataPython
3371345
<gh_stars>0 from time import time ### CONFIGURATION ### WIN_WIDTH = 1280 WIN_HEIGHT = 860 FPS = 40 BACKGROUND_COLOR = (7, 7, 7) FOOD_COLOR = (50, 50, 255) POISON_COLOR = (255, 50, 50) SAVE_TO_CSV = False STARTTIME = str(int(time())) # used to save csv with unique name SAVE_DELAY = 20 * 1000 # in millise...
StarcoderdataPython
8190646
<reponame>tonitick/horovod from __future__ import absolute_import from __future__ import division from __future__ import print_function from mpi4py import MPI import horovod.torch as hvd import torch import time import os import signal from common import env def test(): signal.alarm(45) with env(HOROVOD_STALL_CHE...
StarcoderdataPython
5136306
<reponame>TomFaulkner/News-At-Command-Line<filename>news/config_reader.py import os from contextlib import suppress import yaml from appdirs import AppDirs from .__version__ import __app_name__ from .constants import constants dirs = AppDirs(__app_name__) class ConfigurationReader: def __init__(self): ...
StarcoderdataPython
86584
<reponame>heatonk/caldera_pathfinder import abc class ScannerInterface(abc.ABC): @abc.abstractmethod def scan(self): pass
StarcoderdataPython
212473
import pandas as pd import sys import matplotlib.pyplot as plt if len(sys.argv) != 4: print("give the input file, output file, and title") df = pd.read_csv(sys.argv[1], skipinitialspace=True) output_filename = sys.argv[2] df.plot(x="timestep", legend=False) plt.ylim(ymin=0) plt.title(sys.argv[3]) plt.savefig...
StarcoderdataPython
1747472
<reponame>dskkato/superannotate-python-sdk<gh_stars>0 ''' ''' import json import logging from collections import namedtuple from datetime import datetime from pathlib import Path from PIL import Image import numpy as np import cv2 from ..baseStrategy import baseStrategy from ....common import id2rgb, write_to_json l...
StarcoderdataPython
1924637
import re import requests from ScraperBase import ScraperBase from Common import GetClinicsData, Status, SaveHtmlToTable, LIMITED_THRESHOLD import logging import json class HealthMartPharmacies(ScraperBase): def __init__(self): self.URL = "https://healthmartcovidvaccine.com" # API URL: https://sc...
StarcoderdataPython
3551345
class Solution(object): def isHappy(self, n): def sum_of_digits(num): sum = 0 while num: # num != 0 sum += pow(num % 10, 2) print(sum) num //= 10 return sum while n > 9: n = sum_of_digits(n) ...
StarcoderdataPython
185531
from __future__ import print_function import codecs import json import os from esphome.core import CORE, EsphomeError from esphome.py_compat import safe_input def read_config_file(path): # type: (basestring) -> unicode if CORE.vscode and (not CORE.ace or os.path.abspath(path) == os.p...
StarcoderdataPython
9690681
<filename>graph/migrations/0015_auto_20210215_0350.py # Generated by Django 3.1.4 on 2021-02-14 18:50 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('graph', '0014_auto_20210214_2110'), ] operations = [ migrations.AlterField( ...
StarcoderdataPython
11394494
<reponame>multiii/TinyDBOperations from distutils.core import setup with open(('README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='TinyDBOperations', packages=['TinyDBOperations'], version='0.1', license='MIT', description='A python wrapper used to perform...
StarcoderdataPython
121836
<gh_stars>0 # Author: <NAME> # Creation date: 12 Aug 2021 from mlt.data import DAMatrix from mlt.metric import AccuracyMetric from mlt.metric import ArgmaxMeanMetric from mlt.metric import EmpArgmaxMetric from mlt.metric import AverageRankMetric import numpy as np ### Test cases ### perfs = np.array([ [0, ...
StarcoderdataPython
205316
#!/usr/bin/python import os, time, sys import re import urlparse import requests from bs4 import BeautifulSoup agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.86 Safari/537.36" class Spider(): def __init__(self, year, month, day): self.host ...
StarcoderdataPython
1609640
<gh_stars>1-10 from .Base import BaseTagExtension from shuttl.Models.ContentBlocks.MultipleBlock import MultipleBlock from shuttl.Models.FileTree.FileObjects.Template import Template ## The class for Obtain tags class RepeatTagExtension(BaseTagExtension): ## What tags trigger this extension tags = {'repeat'} ...
StarcoderdataPython
5137353
<filename>gmodsScripts/gmodsTLptopol.py #!/usr/bin/env python """ Requirements: Python 3 or higher Antechamber and related AmberTools OpenBabel (strongly recommended for use with acpype) acpype (latest version recommended with all its requirements) Gromacs (Co...
StarcoderdataPython
95837
<gh_stars>10-100 from app import app from flask_ngrok import run_with_ngrok # run_with_ngrok(app) # app.run()
StarcoderdataPython
5180212
<filename>pfff/build.py """PEP 517 Build backend interface. """ import os import flit.buildapi import flit.inifile import requirementslib def _convert_requirement(r): return '{name}{extra}{version}{marker}'.format( name=r.req.line_part, extra=r.extras_as_pip, version=' ({})'.format(r.spe...
StarcoderdataPython
6613417
<gh_stars>1-10 import pickle class Human: def __init__(self): self.name=input("Enter your name : ") self.age=input("Enter your age : ") def disp(self): print("Hello {}, You are {} year old!".format(self.name,self.age)) num=int(input("Enter the number of people to be entered : ")...
StarcoderdataPython
3485212
T = int(input()) for _ in range(T): H, W, N = map(int, input().split()) floor = (N-1) % H + 1 number = (N-1) // H + 1 print(floor * 100 + number)
StarcoderdataPython
6591577
import unittest from araugment import augment class TestSimple(unittest.TestCase): def test_run(self): augment.back_translate("اهلا وسهلا كيف حالك؟") if __name__ == '__main__': unittest.main()
StarcoderdataPython
395329
<reponame>dashcare/irrexplorer from os import environ import pytest pytestmark = pytest.mark.asyncio IRRD_MEMBEROF_EMPTY_RESPONSE = {"data": {"asSet": [], "autNum": []}} # type: ignore IRRD_MEMBEROF_VALID_RESPONSE = { "data": { "asSet": [ {"rpslPk": "AS-DIRECT", "objectClass": "as-set", "so...
StarcoderdataPython
8021333
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import json import urlparse import tldextract import time import cherrypy import rocksdb from collections import defaultdict sys.path.insert(1, os.path.join(sys.path[0], '..')) from baseline.ccdownloader import CCDownloader def split_uri(uri, encodin...
StarcoderdataPython
3567860
<reponame>reip-project/reip-pipelines<gh_stars>0 from interface import * from plasma import save_data, load_data, save_meta, load_meta, save_both, load_both import pyarrow as pa import numpy as np import pyarrow.plasma as plasma import multiprocessing as mp import time import copy class UniqueID: _id = 0 @st...
StarcoderdataPython
6450928
<gh_stars>0 # ============================================================================== # Copyright 2018-2020 Intel Corporation # # 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 # # ...
StarcoderdataPython
3214079
""" Created by Fanghl on 2020/9/10 13:21 """ # SQLALCHEMY_DATABASE_URI = 'mysql+cymysql://root:123456@127.0.0.1:3306/ginger' SQLALCHEMY_DATABASE_URI = 'mysql+cymysql://root:123456@172.16.31.10:3306/ginger' SQLALCHEMY_TRACK_MODIFICATIONS = True SQLALCHEMY_COMMIT_TEARDOWN = True SECRET_KEY = '<PASSWORD> is a secret'
StarcoderdataPython
4927271
import art def encrypt(text, shift): output = "" for letter in text: pos = alphabet.index(letter) newPos = pos + shift if newPos >= len(alphabet): newPos -= len(alphabet) output += alphabet[newPos] print(output) def decrypt(text, shift): output = "" fo...
StarcoderdataPython
11387542
<reponame>bgerxx/woodpecker import os import sys import traceback import zstackwoodpecker.header.checker as checker_header import zstackwoodpecker.header.vm as vm_header import zstackwoodpecker.operations.resource_operations as res_ops import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as ...
StarcoderdataPython
3559175
from scipy.io import loadmat import numpy as np def load_weights(filename): """ Loads a .mat file into an ndarray. """ weights = loadmat(filename) theta1 = weights['Theta1'] theta2 = weights['Theta2'] theta2 = np.roll(theta2, 1, axis=0) params = np.concatenate([theta1.ravel(), theta2.ravel()...
StarcoderdataPython
1625949
""" Design a program equivalent to Microsoft Paint. This contains shapes, print/load/save functionality, etc. """
StarcoderdataPython
4824176
<gh_stars>1000+ # Copyright 2010 <NAME> <EMAIL> # # 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 agr...
StarcoderdataPython
5070064
<gh_stars>1-10 from typing import Literal, Optional, Union from pydantic import AnyHttpUrl, BaseModel from .model_signature import ModelSignature class Endpoint(BaseModel): url: AnyHttpUrl method: Union[Literal["POST"], Literal["GET"], Literal["PUT"]] signature: Optional[ModelSignature]
StarcoderdataPython
270180
import numpy as np import torch class ReplayBuffer(object): def __init__(self, state_dim, action_dim, device=None, max_size=int(1e6)): self.max_size = max_size self.ptr = 0 self.size = 0 self.state = np.zeros((max_size, state_dim)) self.action = np.zeros((max_size, action_dim)) self.next_sta...
StarcoderdataPython
1606707
import re import pandas as pd dev_size = 20000 train_dir_csv = './train.csv' train_balanced_dir_csv = './train_balanced.csv' dev_dir_csv = './dev.csv' train_dir_tsv = './train.tsv' dev_dir_tsv = './dev.tsv' def remove_link_and_slash_split(sen): regex_link = r'(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@...
StarcoderdataPython
11292484
# # Author: <NAME> # and <NAME> <<EMAIL>) # Lincense: Academic Free License (AFL) v3.0 # import numpy as np from math import pi from mpi4py import MPI try: from scipy import comb except ImportError: from scipy.special import comb import prosper.em as em import prosper.utils.parallel as parallel ...
StarcoderdataPython
9768069
from InquirerPy import inquirer from InquirerPy.validator import PathValidator def main(): src_path = inquirer.filepath( message="Enter file to upload:", default="~/", validate=PathValidator(is_file=True, message="Input is not a file"), only_files=True, ).execute() dest_pat...
StarcoderdataPython
11231240
<filename>src/fastG.py # examples/Python/Advanced/fast_global_registration.py import open3d as o3d from global_registration import * import numpy as np import copy import sys import time def execute_fast_global_registration(source_down, target_down, source_fpfh, target_fpfh, vox...
StarcoderdataPython
8126573
""" Version information for NetworkX, created during installation. Do not add this file to the repository. """ import datetime version = '1.7' date = 'Wed Jul 4 17:53:34 2012' # Was NetworkX built from a development version? If so, remember that the major # and minor versions reference the "target" (rather than "...
StarcoderdataPython
3410576
from selenium.webdriver.common.by import By from time import sleep def get_gas_cost(driver, mail_address, password): # login page driver.get('https://members.tokyo-gas.co.jp/') login_page_link = driver.find_element(By.CLASS_NAME, 'mtg-button-cta').get_attribute('href') driver.get(login_page_link) ...
StarcoderdataPython
3261699
__version__ = "0.6.0" __version_info__ = tuple(int(i) for i in __version__.split("."))
StarcoderdataPython
11287174
# -*- coding: utf-8 -*- from __future__ import division import os,sys,datetime import requests, json import BeautifulSoup import numpy as np import matplotlib.pyplot as plt import matplotlib.dates as mdates import pandas as pd import pandas.io.data as web from data_model import * from data_handler import * from data...
StarcoderdataPython
6407666
from switch_sort import switch_sort def test_first(): assert switch_sort([1, 2, 4, 3]) == 1 def test_second(): assert switch_sort([1, 2, 3, 4]) == 0 def test_third(): assert switch_sort([3, 4, 2, 1]) == 3 def test_fourth(): assert switch_sort([1, 3, 4, 2]) == 2 def test_five(): assert switch_so...
StarcoderdataPython