id
stringlengths
1
7
text
stringlengths
6
1.03M
dataset_id
stringclasses
1 value
118202
# validated: 2017-10-01 DS e4a8bff70e77 cpp/EntryNotifier.cpp cpp/EntryNotifier.h cpp/IEntryNotifier.h """----------------------------------------------------------------------------""" """ Copyright (c) FIRST 2017. All Rights Reserved. """ """ Open Source Software - may be modified and shar...
StarcoderdataPython
1740244
<filename>python/GafferRenderManUI/RenderManRenderUI.py ########################################################################## # # Copyright (c) 2012-2014, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided t...
StarcoderdataPython
1793405
#MIT License #Copyright (c) 2021 <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, dist...
StarcoderdataPython
1701677
#!/usr/bin/env python3 # Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0 # Author (©): <NAME> import logging import unittest from mcthings.block import Block from mcthings.world import World from integration.base import TestBaseThing class TestScene(TestBaseThing): """Test Scene Thing"""...
StarcoderdataPython
3261835
<filename>city_scrapers/mixins/chi_rogers_park_ssa.py import re from collections import defaultdict from datetime import datetime from city_scrapers_core.constants import COMMISSION from city_scrapers_core.items import Meeting from dateutil.relativedelta import relativedelta class ChiRogersParkSsaMixin: timezone...
StarcoderdataPython
3367589
<reponame>cornell-brg/ocn-posh """ ========================================================================== OutputUnitCreditRTL.py ========================================================================== An output unit with a credit based interface. Author : <NAME> Date : June 22, 2019 """ from pymtl3_net.ocnlib...
StarcoderdataPython
162232
<filename>src/win_condition.py from itertools import combinations, permutations # make it more efficient def has_win_condition(player_set): win_states = set(permutations([1,2,3])) | set(permutations([4,5,6])) \ | set(permutations([9,7,8])) | set(permutations([1,4,7])) \ | set(permutations([8,2,5])) |...
StarcoderdataPython
93344
<gh_stars>0 #!/usr/bin/env python # # Copyright (c) 2015-2017 Nest Labs, 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.apac...
StarcoderdataPython
152709
import random import math import numpy as np import cv2 import matplotlib.pyplot as plt __author__ = '__Girish_Hegde__' class Sampler: def __init__(self, radius=1, center=(0, 0), method='rejection_sample'): self.radius = radius self.r2 = radius**2 self.cx, self.cy = ce...
StarcoderdataPython
1794349
import os from random import random, randint import sys sys.path.append('/home/sepideh/ecopia-zebra/mlflow-0.7/') from mlflow.entities import SourceType from mlflow import log_metric, log_param, log_artifacts from mlflow.tracking import MlflowClient if __name__ == "__main__": print("Running mlflow_tracking.py"...
StarcoderdataPython
3314509
<filename>ba_snake_js/__init__.py<gh_stars>0 import logging from gym.envs.registration import register logger = logging.getLogger(__name__) register( id='Planar-direction-parquet-v0', entry_point='ba_snake_js.envs.planar_snake_car:PlanarDirectionParquet', max_episode_steps=1024, ) register( id='Plana...
StarcoderdataPython
56676
from django.shortcuts import render from .forms import YouTubeLinks import pytube,sys from pytube import YouTube # Create your views here. def indexView(request): video_url = "" video_title = "" form = YouTubeLinks() if request.method == "POST": form = YouTubeLinks(request.POST) if form....
StarcoderdataPython
4809818
import speech_recognition as sr import pyttsx3 import pywhatkit import datetime import wikipedia while True: listener = sr.Recognizer() engine = pyttsx3.init() with sr.Microphone() as source: voice = listener.listen(source) def talk(text): engine.say(text) ...
StarcoderdataPython
15565
<filename>armstrong.py start = 104200 end = 702648265 for arm1 in range(start, end + 1): exp = len(str(arm1)) num_sum = 0 c = arm1 while c > 0: num = c % 10 num_sum += num ** exp c //= 10 if arm1 != num_sum: continue else: if...
StarcoderdataPython
3210170
<reponame>nikku1234/InbreastData-Html-Page from flask import Flask, render_template import numpy import matplotlib.pyplot as plt from io import BytesIO import base64 app = Flask(__name__) @app.route('/') def hello_world(): ### Generating X,Y coordinaltes to be used in plot data = numpy.load('Inbr...
StarcoderdataPython
3376623
""" logs view """ import os from flask import current_app, render_template, jsonify, abort, request from . import blueprint SUCCESS, INFO, WARNING, DANGER = 'success', 'info', 'warning', 'danger' def overall_classifier(f): end = f.seek(0, os.SEEK_END) f.seek(max(0, end - 250), os.SEEK_SET) # len(last log...
StarcoderdataPython
1781041
# MIT LICENSE # # Copyright 1997 - 2020 by IXIA Keysight # # 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,...
StarcoderdataPython
3261039
<filename>src/map_generator.py """MAP_GENERATOR This module generates the map which is used in the track plot. This map is made of Open Street Map tiles, which are loaded with iosm module. Author: alguerre License: MIT """ import logging from typing import Tuple import pandas as pd import numpy as np import matplotlib...
StarcoderdataPython
3210326
<gh_stars>1-10 """ Defines the Circuit class """ #*************************************************************************************************** # Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS). # Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government reta...
StarcoderdataPython
1704214
from src.read import TakeEmail from src.transform import TransformData import src.variables as var import json import ast class Categories(): def __init__(self, df): self.categories = None self.index_categories = None self.outcome = df def read_categories(self): file = open(...
StarcoderdataPython
36872
from PyQt5 import QtWidgets, QtCore, QtPrintSupport from PyQt5.QtCore import QDate, QTime, Qt, QTimer, QRectF from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtPrintSupport import QPrinter from database import MyCursor from PyQt5 import QtGui from datetime import datetime, timedelta from annulation i...
StarcoderdataPython
4806336
<gh_stars>0 num_features = 4 last_layerNum = 4 block_cfg = (4, 4) num_classes = 10 drop_rate = 0.5 compress_rate = 0.5 root_dir = "../decompress_mnist" save_path = "../models" valid_rate = 0.2 batch_size = 1 n_epochs = 1
StarcoderdataPython
3359316
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Get the most found caches, allowing additional filters for the status and the German region (*Bundesland*). """ from pathlib import Path import sqlite3 import configuration if configuration.RESTRICT_REGION: # The restrictions are implemented by ...
StarcoderdataPython
3245437
<reponame>ThisIsanAlt/AlternativeBot<gh_stars>1-10 import discord import asyncio from discord.ext import commands, tasks from discord.ext.commands.cooldowns import BucketType import random class Meta(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command() async def dev_...
StarcoderdataPython
131341
#!/usr/bin/env python3 # @Author : <NAME> # @FileName : site_level_eval.py # @Software : NANOME project # @Organization : JAX Li Lab # @Website : https://github.com/TheJacksonLaboratory/nanome """ Generate site-level methylation correlation results in nanome paper. """ import argparse import pybedtools from scipy...
StarcoderdataPython
3386312
''' Este archivo servirá para crear un manejador de contexto que me permtia crear un log file ''' from time import time from contextlib import contextmanager HEADER ="Etrx" FOOTER= "Xtre" @contextmanager def new_log(name): try: logname = name f = open(logname, 'w') f.write(HEADER) ...
StarcoderdataPython
43518
<reponame>stjordanis/QMLT #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2018 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apa...
StarcoderdataPython
3253023
from jira.resources import User class JiraApi: def __init__(self, jira_client, is_cloud, logger): self.jira_client = jira_client self.is_cloud = is_cloud self.logger = logger def delete_user(self, accountId): url = self.jira_client._options['server'] + '/rest/api/latest/user/?...
StarcoderdataPython
4801908
<reponame>enthought/etsproxy<gh_stars>1-10 # proxy module from pyface.ui.wx.wizard.wizard_page import *
StarcoderdataPython
150134
import urllib import seolib import whois import re import dateutil.parser import datetime import requests import ssl, socket from urllib import urlencode from slimit.parser import Parser from bs4 import BeautifulSoup import urlparse from pyfav import get_favicon_url def featureextractor(link): arr = [] domain...
StarcoderdataPython
1769000
# Copyright Contributors to the Packit project. # SPDX-License-Identifier: MIT """ Generic/abstract event classes. """ import copy from datetime import datetime, timezone from logging import getLogger from typing import Dict, Iterable, Optional, Type, Union, Set, List from ogr.abstract import GitProject from packit.c...
StarcoderdataPython
3281374
<gh_stars>0 ''' This module will handle the text generation with beam search. ''' import torch import torch.nn as nn import torch.nn.functional as F from transformer.Beam import Beam from transformer.Models import Transformer class Translator(object): ''' Load with trained model and handle the beam sea...
StarcoderdataPython
122342
import pickle from collections import Counter from itertools import chain import numpy as np from data.dataimport import import_data from data.featuredict import FeatureDictionary from encoders.baseencoder import AbstractEncoder class TfidfEncoder(AbstractEncoder): def decoder_loss(self, data: tuple, representa...
StarcoderdataPython
1685342
<reponame>ecdavis/pants ############################################################################### # # Copyright 2012 Pants Developers (see AUTHORS.txt) # # 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 ...
StarcoderdataPython
3397084
<filename>src/Models/ModelGetter.py # Choose the model to get given its string name # pylint: disable=relative-beyond-top-level from . import SIR from pydoc import locate known_models = { 'SIR': SIR.SIR } def get_model(name): if name in known_models: return known_models[name] model_class = loc...
StarcoderdataPython
67590
# Copyright 2018, <NAME>, mailto:<EMAIL> # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
StarcoderdataPython
163664
#!/usr/bin/env python3 # Copyright 2019 ZTE corporation. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import re import os import subprocess def _get_source_files(root_path): file_name_regex = re.compile(r'(.*\.)?(BUILD|WORKSPACE)|.*\.(bzl|bazel)') for path, dirs, file_names in os.walk(root_pa...
StarcoderdataPython
3377691
import sys import time import copy import pickle import numpy as np import pandas as pd import normalizedDistance from modelConversion import * from pysmt.shortcuts import * from pysmt.typing import * from pprint import pprint from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import RandomForestCl...
StarcoderdataPython
3396381
<gh_stars>0 """Detect the real python interpreter when running in a virtual environment created by the 'virtualenv' module.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json try: # virtualenv <20 from sys import real_prefix except ImportError: real_pref...
StarcoderdataPython
151933
<reponame>Strugglingrookie/oldboy2 import flask from flask_cors import CORS server = flask.Flask(__name__) CORS(server, supports_credentials=True) @server.route("/api/project", methods=["get", "put", "post", "delete"]) def project(): print(flask.request.args) if flask.request.method == "GET": data = ...
StarcoderdataPython
1720068
<reponame>Mahdi-Asaly/Coursera-SDN-Assignments<filename>ProgrammingAssignments/pyretic/pyretic/core/classifier.py from collections import deque import copy ############################################################################### # Classifiers # an intermediate representation for proactive compilation. class ...
StarcoderdataPython
3256293
#!/usr/bin/env/python # coding: utf-8 ''' utilities to write an exposure geo-data model into openquake-compliant nrml (xml) format. ''' import argparse import sys import pandas as pd import os import csv import json from lxml import etree #used by the nrml NAMESPACE = 'http://openquake.org/xmlns/nrml/0.5' GML_NA...
StarcoderdataPython
1605808
import pytest from googleform.questions.radio_list import RadioListQuestion @pytest.fixture(scope="module") def radio_list_paths(fixture_path): return [ fixture_path("radio_list.html"), fixture_path("required_radio_list.html"), fixture_path("other_radio_list.html"), ] @pytest.fixtur...
StarcoderdataPython
3287305
<gh_stars>1-10 """Pytorch impl of MxNet Gluon ResNet/(SE)ResNeXt variants This file evolved from https://github.com/pytorch/vision 'resnet.py' with (SE)-ResNeXt additions and ports of Gluon variations (https://github.com/dmlc/gluon-cv/blob/master/gluoncv/model_zoo/resnet.py) by <NAME> """ import torch.nn as nn import ...
StarcoderdataPython
2246
<gh_stars>1-10 """PyTorch policy class used for Simple Q-Learning""" import logging from typing import Dict, Tuple import gym import ray from ray.rllib.agents.dqn.simple_q_tf_policy import ( build_q_models, compute_q_values, get_distribution_inputs_and_class) from ray.rllib.models.modelv2 import ModelV2 from ray....
StarcoderdataPython
3233742
<gh_stars>10-100 # coding: utf-8 from datetime import date, datetime from kivy.app import App from kivy.uix.stacklayout import StackLayout from kivy.uix.label import Label from infra.view.dia_calendario import DiaCalendario from infra.controller.dia import Dia from infra.controller.data import Data class AreaCalend...
StarcoderdataPython
19281
# Pyspark example called by mlrun_spark_k8s.ipynb from pyspark.sql import SparkSession from mlrun import get_or_create_ctx # Acquire MLRun context mlctx = get_or_create_ctx("spark-function") # Get MLRun parameters mlctx.logger.info("!@!@!@!@!@ Getting env variables") READ_OPTIONS = mlctx.get_param("data_sources") ...
StarcoderdataPython
3276162
import math import torch from torch import nn import torch.nn.functional as F class OmniSoftMax(nn.Module): def __init__(self, num_features, num_classes, cls_type, with_queue=False, l2_norm=False, scalar=1.0, momentum=0.5): super(OmniSoftMax, self).__init__() self.identify_mode = ...
StarcoderdataPython
1759198
<reponame>jonnydubowsky/indy-node<filename>indy_node/server/config_req_handler.py from typing import List from indy_common.authorize.auth_actions import AuthActionEdit, AuthActionAdd from indy_common.authorize.auth_map import auth_map, anyone_can_write_map from indy_common.authorize.auth_request_validator import Write...
StarcoderdataPython
3202893
<gh_stars>100-1000 import logging logging.basicConfig(level=logging.INFO) import matplotlib.pyplot as plt import pyrealsense as pyrs with pyrs.Service() as serv: with serv.Device() as dev: dev.wait_for_frames() plt.imshow(dev.color) # rgb by default plt.show()
StarcoderdataPython
163695
<filename>xbake/mscan/out.py #!/usr/bin/env python # coding=utf-8 # vim: set ts=4 sw=4 expandtab syntax=python: """ xbake.mscan.out Scanner output module @author <NAME> <<EMAIL>> @repo https://git.ycnrg.org/projects/YXB/repos/yc_xbake Copyright (c) 2013-2017 <NAME> / Neo-Retro Group, Inc. https://ycnrg.org/ "...
StarcoderdataPython
1728269
<reponame>vishalbelsare/MVPR import numpy as np from sklearn.preprocessing import PolynomialFeatures from scipy.linalg import svd class MVPR_forward(): def __init__(self,training_data, training_targets, validation_data,validation_targets, regularisation = 'TSVD', verbose=False, search='exponent'): ...
StarcoderdataPython
3343870
<reponame>pmkovar/softwarecollections import logging import os from optparse import make_option from django.core.management.base import CommandError from multiprocessing import Pool, cpu_count from softwarecollections.management.commands import LoggingBaseCommand from softwarecollections.scls.models import Software...
StarcoderdataPython
3251970
from collections import deque from pprint import pprint from src.schedulers.helpers import * from src.utils import task_dict_from_projects def basic_scheduler(task_list, current_day, duration_remaining=8 * 60, with_today=True): """ Takes in flattened project tree with "reward" from some A...
StarcoderdataPython
3291380
<reponame>Kuler2006/BSDS-V40 import json import random from Database.ClubManager import ClubManager from Database.DatabaseManager import DatabaseManager from Logic.Data.DataManager import Writer from Logic.Data.DataManager import Reader from Messaging.Packets.Server.Alliance.AllianceDataMessage import AllianceDataMes...
StarcoderdataPython
53099
<filename>tests/migrations/0014_auto_20200327_1152.py # Generated by Django 2.2.11 on 2020-03-27 10:52 import django_fsm from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("tests", "0013_auto_20200219_1324"), ] operations = [ migrations.AlterField( ...
StarcoderdataPython
3262213
<reponame>Ruweydha/Pitch-hub import unittest from app.models import Pitches, User from app import db class TestPitch(unittest.TestCase): def setUp(self): self.user_ruweydha = User(username='ruweydha', password ='<PASSWORD>', email = '<EMAIL>') self.new_pitch = Pitches(title= 'Technology', content =...
StarcoderdataPython
3230412
<filename>src/sentry/api/endpoints/relay_projectconfigs.py<gh_stars>0 from __future__ import absolute_import import six from rest_framework.response import Response from sentry_sdk import Hub from sentry_sdk.tracing import Span from sentry.api.base import Endpoint from sentry.api.permissions import RelayPermission f...
StarcoderdataPython
104529
from .vcoco_evaluation import VCOCOEvaluator from .hico_evaluation import HICOEvaluator from detectron2.evaluation.evaluator import DatasetEvaluator, DatasetEvaluators, inference_on_dataset from detectron2.evaluation.testing import print_csv_format, verify_results __all__ = [k for k in globals().keys() if not k.starts...
StarcoderdataPython
1792871
import unittest from LuckyNumbers import count from typing import Dict, List class TestLuckyNumbers(unittest.TestCase): """ All the unit tests of the lucky numbers program. """ def test_count_0(self): """ Tests the simplest case, with 0. """ self.assertEqual(count(0), ...
StarcoderdataPython
14987
import os from PIL import Image import seaborn as sn import matplotlib.pyplot as plt import torch import torch.nn.functional as F from sidechainnet.utils.sequence import ProteinVocabulary from einops import rearrange # general functions def exists(val): return val is not None def default(val, d): return va...
StarcoderdataPython
1636715
<reponame>pulumi/pulumi-aws-native # coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, over...
StarcoderdataPython
103845
#!/usr/bin/python from qutilities import * from qutilities.notch import * from fitkit.datasheet import * from sampler import * def fitter(sig1d): z = z_at_f_infty(sig1d, circle_fit(sig1d)[0]) return {'G': 10*np.log10(np.abs(z)), 'theta': np.angle(z)*ureg('radian')}, z metric = percentage_error_metric_creator...
StarcoderdataPython
3235820
<reponame>sirm9/JAVOneStop # -*- coding:utf-8 -*- from flask import Blueprint, jsonify, request, Response import requests from lxml import html from traceback import print_exc import json from blitzdb.document import DoesNotExist from JavHelper.cache import cache from JavHelper.core.ini_file import return_default_conf...
StarcoderdataPython
1605919
<reponame>TidalPaladin/Superliminal-resin #!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2016 KenV99 # # 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 Foundation, either version 3 ...
StarcoderdataPython
174321
<reponame>Balavignesh/badminton-elo-dashboard from dash import Dash, html, dcc,dash_table as dt import dash_bootstrap_components as dbc from dash.dependencies import Input, Output, State import dash_daq as daq import config import utils from typing import List import pandas as pd from multiBatelo.multielo import Multi...
StarcoderdataPython
166382
class BaseIOException(Exception): pass class InvalidFitFile(BaseIOException): pass
StarcoderdataPython
188779
import re examples1 = [ ["(())", 0], ["()()", 0], ["(((", 3], ["(()(()(", 3], ["))(((((", 3], ["())", -1], ["))(", -1], [")))", -3], [")())())", -3] ] examples2 = [ [")", 1], ["()()(", 5] ] def day1a(test=False): if test: inputs = examples1 else: inputs = [[open("d1.txt", "r").read().strip()]] for ...
StarcoderdataPython
1645614
<gh_stars>0 #!/usr/bin/env python3 def e(a, b): if a and b: return True else: return False def ou(a, b): if (not a) and (not b): return False else: return True A = [True, True, False, False] B = [True, False, True, False] for a, b in zip(A, B): print("{} V {} = {...
StarcoderdataPython
4839925
Nov 07 : Nov 08 : **Lecture**{: .label .label-light-blue} X Nov 09 : Nov 10 : **Lecture** Nov 11 : **zyBooks**{: .label .label-orange} Nov 12 : **Nothing Due** Nov 13 : **Nothing Due**
StarcoderdataPython
3215545
<reponame>chemikadze/contrib-python-qubell-client # Copyright (c) 2013 Qubell Inc., http://qubell.com # # 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/LICENS...
StarcoderdataPython
1754236
<gh_stars>0 import pygame class Checkerpiece(pygame.sprite.Sprite): def __init__(self, color, pos): super().__init__() self.color = color try: self.image = pygame.image.load(f'app/assets/piece_{self.color}.png') except Exception: raise Exception(f"La couleu...
StarcoderdataPython
1647313
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Sep 17 20:27:43 2020 @author: leichen """ from pathlib import Path ROOT_DIR = (Path(__file__).resolve().parent / '../../../').resolve() print(ROOT_DIR)# test_dir =Path("/media/leichen/SeagateBackupPlusDrive/KITTI_DATABASE") print(test_dir)
StarcoderdataPython
88162
from typing import List import databases import sqlalchemy from fastapi import FastAPI, status from fastapi.middleware.cors import CORSMiddleware from pydantic import BaseModel, BaseSettings import os import urllib from dotenv_settings_handler import BaseSettingsHandler from dotenv import load_dotenv load_dotenv() #...
StarcoderdataPython
3365897
#encoding=utf8 # Copyright (c) 2021 PaddlePaddle 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
1787978
from datetime import datetime from django.core.management.base import BaseCommand from corehq.util.argparse_types import date_type from custom.icds_reports.reports.disha import build_dumps_for_month from dimagi.utils.dates import add_months_to_date class Command(BaseCommand): help = "Build DISHA data dumps for ...
StarcoderdataPython
152408
bids_schema = { # BIDS identification bits 'modality': { 'type': 'string', 'required': True }, 'subject_id': { 'type': 'string', 'required': True }, 'session_id': {'type': 'string'}, 'run_id': {'type': 'string'}, 'acq_id': {'type': 'string'}, 'task_id...
StarcoderdataPython
47109
<filename>tests/clean/infra/log/utils/colors/test_termcolors.py from clean.infra.log.utils.colors.termcolors import ( DARK_PALETTE, DEFAULT_PALETTE, LIGHT_PALETTE, NOCOLOR_PALETTE, PALETTES, colorize, parse_color_setting, ) def test_empty_string(): assert parse_color_setting('') == PALETTES[DEFAULT_PALETT...
StarcoderdataPython
62300
<reponame>8055aa/Python3Code<filename>Hello.py<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Filename: Hello.py # using: os, random import os,random from collections import Iterable secret = random.randint(1,10) print('-------------------------<NAME>---------------------') temp = input('Please...
StarcoderdataPython
120829
<gh_stars>0 import json import logging import os from datetime import datetime from mimetypes import guess_type from django.conf import settings from django.contrib.auth.decorators import login_required from django.http import HttpResponse, HttpResponseNotFound, JsonResponse from django.shortcuts import redirect, rend...
StarcoderdataPython
86390
<reponame>keoni29/romclient<filename>Src/ui_about.py # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'QT5Designer_AboutROMClient_v04-00.ui' # # Created by: PyQt5 UI code generator 5.10.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets c...
StarcoderdataPython
115911
<filename>migrations/versions/2021_091716_d8c55e79da54_.py """empty message Revision ID: d8c55e79da54 Revises: <PASSWORD> Create Date: 2021-09-17 16:30:23.299011 """ import sqlalchemy_utils from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'd8c55e79da54' down_revisio...
StarcoderdataPython
4829619
<filename>util/create-train-val-split.py #!/usr/bin/env python2 # # Copyright 2015-2016 Carnegie Mellon University # # 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.or...
StarcoderdataPython
3272745
<gh_stars>0 import seaborn as sn import pandas as pd import csv from collections import Counter import matplotlib.pyplot as plt def aa_propensity(input_file_path, output_file_path = 'output.csv'): aminoacid_counter = Counter() with open(input_file_path, 'r') as uniprot_file: for line in uniprot_file: ...
StarcoderdataPython
3365407
#!/usr/bin/env python3 # Copyright 2019 <NAME> <<EMAIL>> # # 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, modif...
StarcoderdataPython
1682532
<gh_stars>0 # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT license. """ rnn """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import numpy as np from tf2onnx import utils from tf2onnx.handler import t...
StarcoderdataPython
1727596
""" @author: <NAME> <<EMAIL>> """ import os import argparse import pickle import oneflow as flow from Wav2Letter.model import Wav2Letter from Wav2Letter.data import GoogleSpeechCommand from Wav2Letter.decoder import GreedyDecoder def get_args(): parser = argparse.ArgumentParser("""Wav2Letter train""") parse...
StarcoderdataPython
86947
<gh_stars>1-10 from PIL import Image filename = "1" ext = ".png" new_res = (16,16) image = Image.open(filename+ext) image_r = image.resize(new_res) image_r.save(filename+'_2'+ext)
StarcoderdataPython
3204449
<reponame>AliliWVIP/SpiderCov<filename>myBaiduData.py # -*- coding: utf-8 -*- __author__ = 'wangli' __date__ = '2020-03-08 19:47' # 爬取百度热搜数据 http://npm.taobao.org/mirrors/chromedriver/ from selenium.webdriver import Chrome, ChromeOptions import time, traceback from myTencentData import get_conn, close_conn def get...
StarcoderdataPython
1630130
#! /usr/bin/python from __future__ import print_function import locale import random import time from math import sin import rrdtool start = int(time.time()) rrd = 'random.rrd' rrdtool.create(rrd, '--start', str(start-1), '--step', '300', 'DS:a:GAUGE:600:U:U', ...
StarcoderdataPython
120012
#!/usr/bin/python3 # -*- coding: utf-8 -*- import re import subprocess import sys from pathlib import Path from dateutil.parser import parse DIRNAME = Path(__file__).parent.absolute() PATTERN = "::error file={},line={}::{}" rc = 0 def log_error(file, line, message): global rc print(PATTERN.format(file.rel...
StarcoderdataPython
3358112
"""Test auto sharding with MLP.""" import unittest from itertools import chain import jax import jax.numpy as jnp import numpy as np from flax import linen as nn from flax import optim from flax.training.train_state import TrainState from jax.interpreters.pxla import Chunked, NoSharding, Replicated, ShardedAxis impor...
StarcoderdataPython
3336196
from rest_framework import serializers from .models import Order class OrderSerializer(serializers.HyperlinkedModelSerializer): item = serializers.JSONField(binary=True) class Meta: model = Order fields = ('id', 'user_name', 'item', 'checkout_date')
StarcoderdataPython
114442
"""Mixins for reducing the amount of boilerplate in the main wrapper class.""" import gtwrap.interface_parser as parser import gtwrap.template_instantiator as instantiator class CheckMixin: """Mixin to provide various checks.""" # Data types that are primitive types not_ptr_type = ['int', 'double', 'bool...
StarcoderdataPython
3247485
<gh_stars>0 import configparser import os, errno class Settings(configparser.ConfigParser): def __init__(self, filepath): configparser.ConfigParser.__init__(self) # save the conf file path self.configFilePath = filepath self.load() def load(self): if not os...
StarcoderdataPython
75844
<reponame>wanghuafeng/auth_login_tools __author__ = 'huafeng' #coding:utf-8 import sys import os def cut_file(filename, partial_count=1): with open(filename) as f: line_list = list(set(f.readlines()))#打乱顺序 lenght_of_lines = len(line_list) print 'total line count: ', lenght_of_lines p...
StarcoderdataPython
1700939
<gh_stars>0 from graph import Graph, UnitNode class Node: def __init__(self, data): self.data = data self.next = None def __str__(self): return str(self.data) def insertion_sort(nums): if nums == []: return None head = Node(nums.pop()) for num in nums: cu...
StarcoderdataPython
3289105
from django.contrib import admin from checkin.models import Skill, Profile, UserSkill, SuggestSkill class ProfileAdmin(admin.ModelAdmin): model = Profile readonly_fields = ('last_checkin',) list_display = ('__str__', 'card_id') class UserSkillAdmin(admin.ModelAdmin): model = UserSkill list_disp...
StarcoderdataPython
3238536
import pickle as pkl import json import pandas as pd import xgboost as xgb import numpy as np # To read directory structure from SETTINGS.json file with open('./../SETTINGS.json', 'r') as f: settings = json.load(f) with open('.' + settings['MODEL_CHECKPOINT_DIR'] + 'best_xgb_model.pkl', 'rb') as f: gbm_model = pkl....
StarcoderdataPython
70866
print("hehe")
StarcoderdataPython