id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
11256656
<reponame>UWaterloo-ASL/LAS_Gym #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Aug 23 00:37:13 2018 @author: jack.lingheng.meng """ #original file: Integration_Demo_for_ROM_Exhibit_new.py import logging from datetime import datetime, date from threading import Timer import os import numpy as np fr...
StarcoderdataPython
12856083
import logging from server.singleton_meta import SingletonMeta log = logging.getLogger(__name__) class PriceCache(metaclass=SingletonMeta): def __init__(self): log.debug("[PriceCache] Init new price cache") self.price_cache = {} def init_cache_for_ticker(self, watched_ticker_id): log.info(f"[PriceCa...
StarcoderdataPython
9601979
""" mbed CMSIS-DAP debugger Copyright (c) 2006-2013 ARM Limited 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 ...
StarcoderdataPython
387859
<gh_stars>0 from aiohttp import web from discord.ext.commands import Bot from db.models.account import Account from db.models.user import User from db.redis import RedisDB from util.discord.messages import Messages from util.env import Env from util.regex import RegexUtil, AddressMissingException, AddressAmbiguousExcep...
StarcoderdataPython
6557176
from base import REF_MARKER, CITATION_NEEDED_MARKER from base import get_localized_snippet_parser
StarcoderdataPython
125202
<reponame>jqueguiner/training_results_v1.0 """NumPy implementation of losses in 3DUnet. https://github.com/mmarcinkiewicz/training/blob/Add_unet3d/image_segmentation/unet3d/model/losses.py """ from __future__ import absolute_import from __future__ import division from __future__ import REDACTED from __future__ import...
StarcoderdataPython
6542213
#!/usr/bin/env python3 from abc import ABC, abstractmethod class AbstractDynamicConfig(ABC): @abstractmethod def to_dynamic_reconfigure(self): """ convert config to dynamic reconfigure dict :return: dynamic reconfigure dict """ pass @abstractmethod def from_d...
StarcoderdataPython
3223967
<gh_stars>10-100 """ extra the last layer embedding of inception3 refer: https://github.com/pytorch/examples/blob/master/imagenet/main.py """ import argparse from tqdm import tqdm import numpy as np import json import datetime import sys import os from scipy.io import loadmat import pickle import torch.nn.functiona...
StarcoderdataPython
338016
#!/usr/bin/python # Author: sc0tfree # Twitter: @sc0tfree # Email: <EMAIL> import os import socket def generate_random_hex(length): ''' Generates a hex string of arbitrary length - 1, ending in a newline. ''' hex_string = os.urandom(length - 1) hex_string += '\x0a' return hex_string host =...
StarcoderdataPython
1640757
""" У нас есть завод, который производит сковородки. Он может делать 2 вида товаров: сковорода, сковорода с крышкой """ from abc import ABC, abstractmethod class Pan: parts: list def __init__(self): self.parts = [] def add_part(self, part): self.parts.append(part) def list_parts(sel...
StarcoderdataPython
11355133
<filename>setup.py from setuptools import setup, find_packages with open("./README.md", "r") as fh: long_description = fh.read() setup( name="glasses", version="0.0.6", author="<NAME> & <NAME>", author_email="<EMAIL>", description="Compact, concise and customizable deep learning computer vis...
StarcoderdataPython
9710291
<filename>src/Honeybee_OpenStudio DX Heating Coil.py # By <NAME> # <EMAIL> # Honeybee started by <NAME> is licensed # under a Creative Commons Attribution-ShareAlike 3.0 Unported License. # this component can be used to create a custom DX coil, either 1 or 2 speed # if you specify a one speed coil, just use the high sp...
StarcoderdataPython
1863058
import os import time import ftplib from urllib.parse import urlparse as urllib_urlparse import urllib3 import bs4 http = urllib3.PoolManager() def urlparse(url): """ :param str url: :return: (scheme, netloc, path, params, query, fragment) :rtype: urllib.parse.ParseResult """ return urllib_u...
StarcoderdataPython
3347877
#!/usr/bin/env python import os import json class Config(): CALIBRATION = -11600.00 _config = None _config_file_Path = None def __init__(self, config_file_path ): if ( True == os.path.isfile ( config_file_path ) ): with open ( config_file_path, "r" ) as f: sel...
StarcoderdataPython
283574
import re def read_file(path: str = "input") -> str: with open(path) as file: return file.read() def part_1(): fields = {"byr", "iyr", "eyr", "hgt", "hcl", "ecl", "pid"} content = read_file().split("\n\n") print("Solution for part 1 of day 4:", sum((set(y.split(":")[0] for y in x.split()) - ...
StarcoderdataPython
1790706
<gh_stars>0 # -*- encoding: utf-8 -*- import pprint import requests import datetime from influxdb import InfluxDBClient TODOS_API = "https://api.pomotodo.com/1/todos" HAEDER = { "Authorization": "token" } def get_todos(): res = requests.get(TODOS_API, headers=HAEDER) data = res.json() list_data = lis...
StarcoderdataPython
4870099
from pyspark import SparkContext, SparkConf from pyspark.sql import SQLContext, Row import os """ This function obtains the name of summary statistics """ def get_txt_file_name_summary_statistics(): return 'vs_energies_summary_statistics.txt' """ This function obtains the name of summary statistics """ def ge...
StarcoderdataPython
5077100
<filename>tests/test_accountdata_filter.py import os import datetime import pytest from homeplotter.accountdata import AccountData from homeplotter.timeseries import TimeSeries resource_path = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', 'example_data')) cat_path = os.path.join(resource_path,"categ...
StarcoderdataPython
11239280
s = float(input('O salário inicial é de: R$')) a = 15 ns = (s * (1 + a / 100)) print('O salário com aumento de {}% é: R${:.2f}'.format(a, ns))
StarcoderdataPython
1607587
<filename>contrib/devtools/github-merge.py #!/usr/bin/env python3 # Copyright (c) 2016-2017 The Cruro Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # This script will locally construct a merge commit for a pull r...
StarcoderdataPython
1943068
<reponame>SunsetWolf/qlib from qlib.data.dataset.handler import DataHandler, DataHandlerLP EPSILON = 1e-4 class HighFreqHandler(DataHandlerLP): def __init__( self, instruments="csi300", start_time=None, end_time=None, infer_processors=[], learn_processors=[], ...
StarcoderdataPython
8026576
''' Implements extension to d1_common.resource_map to assist with populating an index of ORE relationships. ''' import logging from d1_common import resource_map class OreParser(resource_map.ResourceMap): def getRelations(self): ''' Retrieve the dataset relationships from package. Returns: { ...
StarcoderdataPython
159906
<reponame>Samayel/sdr-gnuradio-projects<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- # # SPDX-License-Identifier: GPL-3.0 # # GNU Radio Python Flow Graph # Title: FMradio (PlutoSDR) # GNU Radio version: v3.8.2.0-60-g25b63e7e from distutils.version import StrictVersion if __name__ == '__main__': impo...
StarcoderdataPython
6494930
from .util import normalize, rotx, roty, rotz, get_rgba, translate, scale from .shapes import GlQuad, GlTri, GlVertices, GlCube, GlSphericalRect, GlSphericalCirc, GlCylinder, GlSphericalPoints, GlSphericalTexturedRect
StarcoderdataPython
3475647
# -*- coding: utf8 -*- from __future__ import absolute_import, division, print_function from __future__ import unicode_literals from pylero.base_polarion import BasePolarion class FieldDiff(BasePolarion): """Object to handle the Polarion WSDL tns3:FieldDiff class Attributes: added (ArrayOf_xsd_anyTyp...
StarcoderdataPython
5004391
# Generated by Django 3.1.4 on 2020-12-19 12:39 import blog.models from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blog', '0005_auto_20201211_2246'), ] operations = [ migrations.CreateModel( name='Document', fiel...
StarcoderdataPython
9662573
# -*- coding: utf-8 -*- """A client for interacting with APICURON.""" from .api import ( Achievement, DESCRIPTION_URL, Description, RESUBMISSION_URL, Report, Submission, Term, resubmit_curations, submit_description, ) __all__ = [ # URLs "DESCRIPTION_URL", "RESUBMISSION...
StarcoderdataPython
11255956
<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2017-12-10 16:17 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import uuid class Migration(migrations.Migration): initial = True dependencies = [ ('account', '0003_...
StarcoderdataPython
6477745
import abc import warnings from enum import Enum from math import ceil from .imaging import ImagingInformation, Modes class LabViewVersions(Enum): pre2018 = "pre-2018 (original)" v231 = "2.3.1" class LabViewHeader(metaclass=abc.ABCMeta): """A class to represent all information stored in a LabView heade...
StarcoderdataPython
11237355
<gh_stars>0 #!/usr/bin/env python """ Indexer module Manages the multiprocess approach to indexing the database. This module spawns a fixed number of worker process where each worker feeds repository urls fetched from the queue. These are passed to the indexing object. The worker is defined by worker.py which is the ...
StarcoderdataPython
9746694
import os from glob import glob from textwrap import dedent import numpy as np import pytest import pytest_mpl import astropy from astropy.coordinates import SkyCoord from astropy import units as u import pygedm import fruitbat from fruitbat import Frb, utils, cosmologies, methods, table, plot, catalogue def test...
StarcoderdataPython
280043
__version__ = "0.0.1" import uuid import time import traceback from importlib.metadata import version # PYTHON >= 3.8 from loguru import logger from fastapi import FastAPI from starlette.requests import Request from starlette.responses import JSONResponse from starlette.exceptions import HTTPException from starlett...
StarcoderdataPython
1951683
from . import auth from flask import render_template, redirect, url_for, flash, request from ..models import User from .forms import RegistrationForm, LoginForm from .. import db from flask_login import login_user, current_user, logout_user, login_required from ..email import mail_message @auth.route("/login", methods...
StarcoderdataPython
6693922
# -*- coding: utf-8 -*- """ Copyright (c) 2018 <NAME> GmbH All rights reserved. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. @author: <NAME> """ import abc import numpy as np from scipy import interpolate def gLin(m, s, A, b=None): if ...
StarcoderdataPython
6520633
print("ANALISADOR DE TRIÂNGULOS . . .\n") segmento1 = float(input("Primeiro segmento: ")) segmento2 = float(input("Segundo segmento0: ")) segmento3 = float(input("Terceiro segmento0: ")) if segmento1 < segmento2 + segmento3 and segmento2 < segmento1 + segmento3 and segmento3 < segmento1 + segmento2: triang...
StarcoderdataPython
6643343
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack.main import print_setup_info def test_print_shell_vars_sh(capsys): print_setup_info('sh') out, _ = ca...
StarcoderdataPython
5042476
<filename>src/qsubsettings.py<gh_stars>0 import re from functools import wraps import os _QSUBCMD = 'qsub' _QSUBSYNOPSIS = 'qsub [-a date_time] [-A account_string] [-b secs] [-c checkpoint_options]\ [-C directive_prefix] [-cwd] [-clear] [-d path] [-D path] [-e path] [-f] [-F] [-h]\ [-I ] [-j join ] [-k keep ] [-l res...
StarcoderdataPython
3514089
import torch from torch import nn from torch import distributions as torch_dist from itertools import chain import math import numpy as np from torch.nn import functional as F from operator import itemgetter from diayn_seq_code_revised.trainer.trainer_seqwise_stepwise_revised import \ DIAYNAlgoStepwiseSeqwiseRevis...
StarcoderdataPython
6605504
<gh_stars>0 # MIT License # # Copyright (c) 2018 <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, m...
StarcoderdataPython
11324293
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- import os import glob from setuptools import setup, find_packages import codecs from haveibeenpwned_asyncio import __version__ scripts = glob.glob("bin/*") this_directory = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(this_directory, "READ...
StarcoderdataPython
4881122
import os from countryinfo import CountryInfo from pyrogram import Client, filters from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton, InlineQueryResultArticle, InputTextMessageContent from .database import db START_TEXT = """Hello {} 😌 I am a country information finder bot. >> `I can find inform...
StarcoderdataPython
11253332
import random print('주사위를 굴립니다') com = random.randint(1, 6) user = random.randint(1, 6) print('컴퓨터의 주사위 눈은 ' + str(com) + '입니다') print('당신의 주사위 눈은 ' + str(user) + '입니다') if com > user : print('컴퓨터가 승리하였습니다') elif com == user : print('비겼습니다. 다시 굴려보세요.') else : print('당신이 이겼습니다.')
StarcoderdataPython
5095339
<reponame>CLARIN-PL/embeddings<filename>tests/test_pipelinebuilder.py import os import tempfile from typing import Dict from embeddings.data.data_loader import DataLoader, Input, Output from embeddings.data.dataset import Dataset from embeddings.embedding.embedding import Embedding from embeddings.evaluator.evaluator ...
StarcoderdataPython
1709323
# =========================================================== # ========================= imports ========================= import sys import datetime from gnsspy.funcs.funcs import (gpsweekday, datetime2doy) from gnsspy.doc.IGS import IGS, is_IGS # =========================================================== d...
StarcoderdataPython
1998756
<reponame>ulnic/weatherSensor_rpi #!/usr/bin/python """ CPU Sensor """ import logging import subprocess from data.sensors.AbstractSensor import AbstractSensor from data.Constants import Constant logger = logging.getLogger(Constant.LOGGER_NAME) class CPUSensor(AbstractSensor): """ CPU Sensor class which reads...
StarcoderdataPython
3467626
<filename>core/ClientManager.py from core.TCPClient import TCPClient from experiment.RTTAdaptiveClient import RTTAdaptiveClient from experiment.PowerAdaptiveClient import PowerAdaptiveClient from experiment.PowerTWClient import PowerTWClient from experiment.PowerChangeTWClient import PowerChangeTWClient from experiment...
StarcoderdataPython
5071162
<filename>server.py from src.gui.Server import Server server = Server()
StarcoderdataPython
228835
# UNIDAD 06.D19 - D21 # Programación Orientada a Objetos (POO) print('\n\n---[Diapo 19]---------------------') print('POO - Constructor') class Galletita: sabor = 'Dulce' color = 'Negra' chips_chocolate = False def __init__(self): print('Se acaba de crear una galletita') mi_galletita = ...
StarcoderdataPython
29501
import math import sys from fractions import Fraction from random import uniform, randint import decimal as dec def log10_floor(f): b, k = 1, -1 while b <= f: b *= 10 k += 1 return k def log10_ceil(f): b, k = 1, 0 while b < f: b *= 10 k += 1 return k def log10_...
StarcoderdataPython
1871168
# coding=utf-8 from bs4 import BeautifulSoup import re def unstandard_count(soup,tag_name,tag,standard_format): subjects=soup.select(tag_name) print("length subs info: ",len(subjects)) sum_all = 0 for sub in subjects: tags=sub.find_all(tag) style_tag=sub.find_all(tag,{"style":re.compile...
StarcoderdataPython
3241303
<filename>src/forecastga/models/template.py #! /usr/bin/env python # coding: utf-8 # """ARIMA Model""" from forecastga.models.base import BaseModel class ARIMA_Model: """ARIMA Model Class""" def __init__(self, config): super().__init__(config) """ Available model attributes: ...
StarcoderdataPython
5099533
<gh_stars>0 # -*- coding: utf-8 -*- def compare_word(targets, word, distance_penalty=0.0): """ Select the best matching word out of a list of targets. :param targets: A list of words from which the best match is chosen :param word: Word to compare with :param distance_penalty: A Penalty that is a...
StarcoderdataPython
107275
from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) # set database name app.database = "agents.db" # load the config app.config["DEBUG"] = False app.config["SECRET_KEY"] = <KEY>' app.config["SQLALCHEMY_DATABASE_URI"] = 'sqlite:///agents.db' app.config["SQLALCHEMY_TRACK_MODIFICATIONS"]...
StarcoderdataPython
3386272
<filename>utils.py<gh_stars>0 #!/usr/bin/env python # coding: utf-8 # In[ ]: #We create our preprocessing function def preprocess(string): import nltk nltk.download('punkt') nltk.download('stopwords') from nltk.corpus import stopwords from nltk.stem import PorterStemmer from nltk.tokeni...
StarcoderdataPython
11359911
import logging import MySQLdb import time #I do not claim to write beautiful code def fixFormatString(fmt): final = "" inc = 0 for part in fmt.split("%s"): final += part + "'{" + str(inc) + "}'" inc += 1 return final[:-len(str("'{"+str(inc - 1)+"}'"))] #Michael has signed off on not sanitizing inputs class Do...
StarcoderdataPython
1804030
<filename>examples/hex_board.py import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from hex_maze import Board panel = Board(9, 9, entry_pos=(0, 2)) panel[4][4].omit() panel.omit_tiles( [ (0, 0), (0, 1), (1, 1), (0, 0), (1...
StarcoderdataPython
272049
#!/usr/bin/env python # -*- coding: utf-8 -*- from udkm1Dsim import Atom from udkm1Dsim import UnitCell from udkm1Dsim import Structure from udkm1Dsim import u u.default_format = '~P' def test_structure(): Dy = Atom('Dy') uc = UnitCell('uc', 'Unit Cell', 3.1*u.angstrom, heat_capacity=10*(u.J/u.kg/u.K), ...
StarcoderdataPython
1775829
''' @author: HeQingsong @date: 2020-09-19 21:18 @filename: test.py @project: huobi_Python @python version: 3.7 by Anaconda @description: ''' from huobi.client.generic import GenericClient, CandlestickInterval from huobi.client.market import MarketClient from mycode.market import MarketQuotationUtils...
StarcoderdataPython
3380200
# Copyright (c) 2018 Yubico AB # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditi...
StarcoderdataPython
1951451
<filename>humann2/tests/functional_tests_biom_tools.py import unittest import tempfile import os import cfg import utils class TestFunctionalHumann2ToolsBiom(unittest.TestCase): """ Test humann2.tools """ def test_humann2_join_tables_biom(self): """ Test joining biom files with humann...
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
6602415
<gh_stars>1-10 import json from django_pds.conf import settings from .manager import BaseManager OWNER = 'owner' class GenericInsertCommandManager(BaseManager): def __modify_ids(self, __defaults, user_id): items = [] for _id in __defaults: if _id == OWNER: items.appe...
StarcoderdataPython
4973659
import cv2 import numpy as np from pupil_apriltags import Detector import time import glob from matplotlib import pyplot as plt import matplotlib.patches as patches import numpy as np from skimage.transform import resize at_detector = Detector(families='tag36h11',nthreads=1,quad_decimate=1.0,quad_sigma=0.0,refine_edge...
StarcoderdataPython
6469870
#!/usr/bin/env python """ read trained net : model+weights read test data from HD5 infere for test data Inference works alwasy on 1 IPU ./predict_one.py -m outY -X """ __author__ = "<NAME>" __email__ = "<EMAIL>" import numpy as np import torch import time import sys,os import logging from toolbox.Model impor...
StarcoderdataPython
4989307
import json from flask import Flask, Response app = Flask(__name__) class empleados: sueldo = 0 hdiurnas = 0 hnocturnas = 0 auxilio = 0 totalDed = 0 totalDev = 0 total = 0 diurnas = 0 nocturnas = 0 def __init__(self, sueldo, diurnas, nocturnas): self.sueldo = sueldo ...
StarcoderdataPython
3590984
# coding=utf-8 import streamlit as st import numpy as np import pandas as pd import pandas_profiling from streamlit_pandas_profiling import st_profile_report from matplotlib.image import imread ####################################################################### # Loading data (labelled) #-------------------------...
StarcoderdataPython
1733561
<reponame>AI-Factor-y/Attendance-automation<filename>eduserver automation/timetable.py ## this code is written and managed by abhinav -p (@_ai_factory) ## <EMAIL> days=["monday","tuesday","wednesday","thursday","friday"]; #active classes are those classes for which you have to put attendance #only those clas...
StarcoderdataPython
6402438
<filename>high_lvl_networking/networking.py """ a script for simpliefiying the communication between the server and the client server: setup() -> inits the server new_connection() -> adds a new connection to the server with the given id get() -> tries to get the a message from the client with the specified id p...
StarcoderdataPython
4908456
import argparse from pathlib import Path from catbird.core import dump, load from stanza.server import CoreNLPClient from tqdm import tqdm def extract_triples(client, text): ann = client.annotate(text) triples = [] for sentence in ann.sentence: for triple in sentence.openieTriple: tri...
StarcoderdataPython
3452988
<gh_stars>1-10 # Twowaits Twowaits Problem def up_pattern(n): s=2*n-2 for i in range(0,n): for j in range(0,i): print(end=" ") print("*",end='') for k in range(s): print(end=' ') s=s-2 print('*',end='') print('\r') def low_pattern(n): f...
StarcoderdataPython
1695358
leaf_trait_id_and_name = { 0: 'Class', 1: 'Specimen Number', 2: 'Eccentricity', 3: 'Aspect Ratio', 4: 'Elongation', 5: 'Solidity', 6: 'Stochastic Convexity', 7: 'Isoperimetric Factor', 8: 'Maximal Indentation Depth', 9: 'Lobedness', 10: 'Average Intensity', 11: 'Average C...
StarcoderdataPython
48007
# -*- coding: utf-8 -*- # (The MIT License) # # Copyright (c) 2013-2021 Kura # # 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 # ...
StarcoderdataPython
11347198
#!/usr/bin/env python import support.states as states counties = {} def load_data(): if counties: return with open('data/co-est2019-annres.dat') as fp: for line in fp: line = line.strip() county,state,pop = line.split('|') state = states.us_state_abbrev[sta...
StarcoderdataPython
1891735
<reponame>verkaik/modflow6-parallel """ MODFLOW 6 Autotest Test to compare MODFLOW 6 groundwater transport simulation results to MT3DMS results. This test was first documented in Zheng and Wang (1999) (MT3DMS: A Modular Three-Dimensional Multispecies Transport Model for Simulation of Advection, Dispersion, and Chemica...
StarcoderdataPython
4843910
<reponame>Ahammmad-Shawki8/AS8-repository # advanced python # what is advanced python? # it means python spreading its wings across multiple dimentions and use-cases in many fields. # python is really a powerful oop language. it can be used in many advanced concepts too. # some advanced concepts are- # 1. sys prog...
StarcoderdataPython
258046
<filename>critic.py<gh_stars>0 # -*- coding: utf-8 -*- import torch import torch.nn as nn import torch.nn.functional as F import numpy as np class Critic(nn.Module): def __init__(self, input_size, seed): super(Critic, self).__init__() self.seed = torch.manual_seed(seed) ...
StarcoderdataPython
8133418
#!/usr/bin/env python3 # # "Spotlight" over a larger image # Shows a small window of a full image # Results transmitted via RabbitMQ # # @author <NAME> <<EMAIL>> # @copyright 2022 # from PIL import Image from time import sleep import random import pika import json from pprint import pprint import sys # *********...
StarcoderdataPython
6415185
import os import sys import numpy as np from setuptools import setup, Extension from Cython.Distutils import build_ext NAME = "mbircone" VERSION = "0.1" DESCRIPTION = "Python Package for Cone Beam reconstruction" REQUIRES = ['numpy','Cython','psutil','Pillow'] # external package dependencies LICENSE = "BSD-3-Clause" ...
StarcoderdataPython
304943
<reponame>knowledgetechnologyuhh/goal_conditioned_RL_baselines import numpy as np import gym import pickle from baselines import logger from baselines.herhrl.ddpg_her_hrl_policy import DDPG_HER_HRL_POLICY from baselines.herhrl.mix_pddl_hrl_policy import MIX_PDDL_HRL_POLICY from baselines.herhrl.pddl_policy import PDDL...
StarcoderdataPython
6437119
<filename>katana/cigar.py<gh_stars>1-10 """Basic CIGAR manipulation and querying. """ from __future__ import print_function, absolute_import, division import itertools import re import katana.util as util class CigarUtil(object): _QUERY_CONSUMING = set(list("MIS=X")) _REF_CONSUMING = set(list("MDNS=X")) ...
StarcoderdataPython
5162722
class ThecampyException(Exception): pass class ThecampyValueError(ThecampyException): pass class ThecampyReqError(ThecampyException): #Request오류들 pass
StarcoderdataPython
157500
import os import re import collections import shutil import traceback from os.path import join from xml.dom import minidom print("Start") a = [] rpt = [] Folders = [] Address = [] def list_duplicates(seq): global t t = False seen = set() seen_add = seen.add seen_twice = set( x for x in seq if x in...
StarcoderdataPython
1773953
# 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
6613468
<reponame>tsilifis/quinoa import numpy as np import kernel_py as kp import scipy.stats as st from scipy import linalg from matplotlib import cm import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D #%matplotlib inline def build_up_b(b, rho, dt, u, v, dx, dy): b[1:-1, 1:-1] = (rho * ( (1. / dt) *...
StarcoderdataPython
9610245
#Input The Age, if age>18 print adult , if 10 age = int(input("Type your age: ")) if age > 18: print("Adult") else: print("You are not an adult yet.")
StarcoderdataPython
8004081
import json import os import argparse parser = argparse.ArgumentParser() parser.add_argument('--savedir',help='directory to save downloaded InstaVariety videos') args = parser.parse_args() savedir = args.savedir # create the save directory if it doesn't exist os.system('mkdir -p {}'.format(savedir)) ## NOTE: this as...
StarcoderdataPython
8195764
from InstaBot import InstaBot from Logger import Logger from ConfigHandler import ConfigHandler import sys, os , datetime, time, logging import pickle def save(data): with open('./data.p', 'wb') as fp: pickle.dump(data, fp, protocol=pickle.HIGHEST_PROTOCOL) def load_data(path) ->dict: if os.path.isfile(...
StarcoderdataPython
6680575
<reponame>richard-parks/RAPTR import django_filters from django_filters import FilterSet from shared.models import Contact from .models import Proposal class ProposalFilter(FilterSet): investigator_supported = django_filters.ModelChoiceFilter(queryset=Contact.objects.all().filter(active=True, is_pi=True), looku...
StarcoderdataPython
1847694
<filename>pychron/lasers/stage_managers/stage_visualizer.py # =============================================================================== # Copyright 2012 <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 ...
StarcoderdataPython
5177540
<gh_stars>10-100 # -*- coding: utf-8 -*- from ocelot.transformations.production_volumes import add_pv_to_allocatable_byproducts def test_add_pv_to_allocatable_byproducts(): given = [{ 'name': '', 'exchanges': [{ 'name': '', 'amount': 3, 'type': 'byproduct', ...
StarcoderdataPython
3456943
<reponame>markreidvfx/pct_titles<filename>pct_titles/__init__.py from pctobjects import PctFile, TitlePage, TitleText, TitleRectangle, TitleOval, TitleLine, TextFormat
StarcoderdataPython
19164
from app.models.classes_basicas.Pessoa import Pessoa class Empregado(Pessoa): id_empregado = None def getIdEmpregado(self): return self.id_empregado def setIdEmpregado(self, id_empregado): self.id_empregado = id_empregado
StarcoderdataPython
3216775
<reponame>melster1010/VIAME # Copyright (c) Microsoft Corporation. All rights reserved. # 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 ...
StarcoderdataPython
3345327
# $Header: /opt/cvs/python/packages/share1.5/Pmv/fileCommandsGUI.py,v 1.9.2.1 2011/04/08 21:17:29 sargis Exp $ from ViewerFramework.VFCommand import CommandGUI, CommandProxy class PDBWriterProxy(CommandProxy): def guiCallback(self, **kw): if self.command: self.command.guiCallback(**kw) ...
StarcoderdataPython
4937074
<reponame>uxlsl/shop_test<gh_stars>1-10 from django.shortcuts import get_object_or_404 from rest_framework import viewsets from rest_framework.response import Response from rest_framework.decorators import api_view, renderer_classes from rest_framework import response, schemas from rest_framework_swagger.renderers imp...
StarcoderdataPython
1653741
<reponame>DalavanCloud/pysilfont #!/usr/bin/env python from __future__ import unicode_literals '''Update glyph names in a font based on csv file - Using FontForge rather than UFOlib so it can work with ttf (or sfd) files''' __url__ = 'http://github.com/silnrsi/pysilfont' __copyright__ = 'Copyright (c) 2016 SIL Inter...
StarcoderdataPython
9638036
""" Access to relabelling from templates. """ import logging from typing import Sequence from django import template from django.template import Context from CreeDictionary.CreeDictionary.relabelling import read_labels from CreeDictionary.morphodict.templatetags.morphodict_orth import orth_tag from CreeDictionary.ut...
StarcoderdataPython
3473374
from rtamt.operation.abstract_operation import AbstractOperation from rtamt.operation.sample import Sample from rtamt.operation.sample import Time class OnceOperation(AbstractOperation): def __init__(self): self.prev_out = Sample() self.input = Sample() self.prev_out.seq = 0 self.p...
StarcoderdataPython
5130831
import logging import string import math import re import struct import itertools from collections import defaultdict import claripy import simuvex import pyvex from simuvex.s_errors import SimEngineError, SimMemoryError, SimTranslationError from ..blade import Blade from ..analysis import register_analysis from ..su...
StarcoderdataPython
3412149
# -*- coding: utf-8 -*- ################################################################################ # Copyright (C) 2013 <NAME> <<EMAIL>> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundati...
StarcoderdataPython