id
stringlengths
2
8
text
stringlengths
16
264k
dataset_id
stringclasses
1 value
6650211
<filename>tricircle-6.0.0/tricircle/network/security_groups.py # Copyright 2015 Huawei Technologies Co., Ltd. # 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 # ...
StarcoderdataPython
3531489
<filename>add_embedding.py # -*- coding: UTF-8 -*- from transformers import pipeline import pandas as pd from opencc import OpenCC import pickle df = pd.read_csv('./data/city_data.csv') cc = OpenCC('t2s') # 繁體中文 -> 簡體中文 https://yanwei-liu.medium.com/python%E8%87%AA%E7%84%B6%E8%AA%9E%E8%A8%80%E8%99%95%E7%90%86-%E5%9B%9...
StarcoderdataPython
120249
<filename>pyconafrica/ghana19/team.py """ This file contains organizing team description related code. """ from colorama import init, Style, Fore, Back init() TEAM = [ { 'name': '<NAME>', 'role': 'Chair of the organising committee.', 'bio': \ """Marlene is a Director of the Python Software ...
StarcoderdataPython
9662102
<reponame>MyYaYa/deeplab-tensorflow import tensorflow as tf import numpy as np class MyData(object): def __init__(self, record, image_mean, shuffle=False, buffer_size=1000, batch_size=10, repeat=False, repeat_times=None): self.record = record self.image_mean = image_mean self.shuffle = shu...
StarcoderdataPython
3578286
<gh_stars>0 from django.db import models from django.conf import settings from products.models import Product from django.db.models.signals import m2m_changed, pre_save User = settings.AUTH_USER_MODEL class CartManager(models.Manager): def new_or_get(self, request): cart_id = request.session.get('cart_id'...
StarcoderdataPython
8114258
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Nov 13 16:00:10 2019 @author: nico """ import os import numpy as np from scipy import signal as sig import matplotlib.pyplot as plt import control os.system ("clear") # limpia la terminal de python plt.close("all") #cierra todos los graficos num =...
StarcoderdataPython
330458
#!/usr/bin/env python3 """example.py Example of using the AmesPAHdbPythonSuite to display the ('stick') absorption spectrum of coronene (UID=18). """ import pkg_resources from amespahdbpythonsuite.xmlparser import XMLparser import matplotlib.pyplot as plt if __name__ == '__main__': path = 'resources/pahdb-th...
StarcoderdataPython
3487407
from pydantic import BaseModel, validator from .validators import gt0 class BaseRule(BaseModel): bal: int = 0 _gt0_bal = validator("bal", allow_reuse=True)(gt0) class NullRuleFields(BaseModel): bal: int = 0
StarcoderdataPython
356581
<reponame>wangyum/anaconda import numpy as np from .util import collect, dshape from .internal_utils import remove from .coretypes import (DataShape, Fixed, Var, Ellipsis, Record, Tuple, Unit, date_, datetime_, TypeVar, to_numpy_dtype, Map, Option, Categorical) from .typ...
StarcoderdataPython
5178196
<gh_stars>1-10 """ # Sample code to perform I/O: name = input() # Reading input from STDIN print('Hi, %s.' % name) # Writing output to STDOUT # Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail """ # Write your code here from collections import defa...
StarcoderdataPython
1664685
<filename>deepmd/xyz2raw.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import json import argparse from collections import Counter from ase.io import read, write from tqdm import tqdm import dpdata if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument( '-...
StarcoderdataPython
6479295
# # Copyright 2018-2019 IBM Corp. 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...
StarcoderdataPython
4884506
import sys import os import logging import MySQLdb from django.core.management.base import BaseCommand, CommandError from django.conf import settings from dotenv import load_dotenv load_dotenv() rds_host = os.getenv('MYSQL_IP') db_name = os.getenv('DB_NAME') user_name = os.getenv('MYSQL_ID') password = os.getenv('<P...
StarcoderdataPython
1991714
from RNAtools.graph import CTGraph import os filepath = os.path.dirname(__file__) def test_ct_graph(): """ Tests that CT graph construction is done correctly. """ ct = CTGraph(f'{filepath}/../data/foo.ct') assert len(ct.graph.nodes) == 21 assert len(ct.graph.edges) == 28 print(ct)
StarcoderdataPython
11280280
<reponame>matthiask/django-multilingual-search # coding: utf-8 from __future__ import absolute_import, unicode_literals from django.db import models from haystack import signals from .models import Document class DocumentOnlySignalProcessor(signals.BaseSignalProcessor): def setup(self): # Listen only to t...
StarcoderdataPython
11363815
from flask_restplus import Api from .auth import api as ns3 from .book import api as ns2 from .user import api as ns1 api = Api( title="", version="1.0", description="API description", ) api.add_namespace(ns1) api.add_namespace(ns2) api.add_namespace(ns3)
StarcoderdataPython
6470052
<gh_stars>1-10 #!/usr/bin/env python #--------------------------------------------------------------------------- # Instantiates a ROS node that sets velocities for a standalone Teledyne # WHN DVL model in the gazebo scene. The velocity is set relative to the # DVL base link to drive in an octagon pattern (forward, f...
StarcoderdataPython
3240031
<gh_stars>0 class RunData(object): """Parent class for runs. """ def __init__(self, control_file, log_file=None, energy_file=None): self._control_file = control_file self._log_file = log_file self._energy_file = energy_file self._parameters = {} self._tags = [] ...
StarcoderdataPython
4879546
import pytest import src.single_hmm_searcher class singleHmmTestCase(object): '''Tests for single_hmm_searcher.py''' # Eventually will add tests
StarcoderdataPython
4896230
from models import db class Volunteer(db.Model): __tablename__ = "volunteers" volunteer_id = db.Column(db.Integer, primary_key=True) first_name = db.Column(db.String, nullable=False) last_name = db.Column(db.String, nullable=True) email = db.Column(db.String, nullable=False) phone = db.Column(...
StarcoderdataPython
12836862
import torch import torch.nn as nn import torch.nn.functional as F class AbstractFold(nn.Module): def __init__(self, predict, partfunc): super(AbstractFold, self).__init__() self.predict = predict self.partfunc = partfunc def clear_count(self, param): param_count = {} ...
StarcoderdataPython
11215335
<filename>Lote de cancelamento/Arquivo de Cancelamento.py import pandas as pd import xml.etree.ElementTree as ET import time dados_cancelamento = pd.read_excel() # Chamada de arquivo ListaCancelamento = dados_cancelamento.values.tolist() # Referencial de valores para contagem da estrutura de repetição Codi...
StarcoderdataPython
4854759
#!/usr/bin/env python2 """Create segmentation datasets from select SMPL fits.""" import os import os.path as path import sys import logging import numpy as np import scipy import click import tqdm from clustertools.log import LOGFORMAT from clustertools.visualization import apply_colormap from up_tools.model import (...
StarcoderdataPython
4817600
# coding: utf-8 """ Trend Micro Deep Security API Copyright 2018 - 2020 Trend Micro Incorporated.<br/>Get protected, stay secured, and keep informed with Trend Micro Deep Security's new RESTful API. Access system data and manage security configurations to automate your security workflows and integrate De...
StarcoderdataPython
1867410
#!/usr/bin/env python """ Web app specific utilities. In particular, it handles tasks related to deployment and minimization which are not relevant to other Overwatch packages. .. codeauthor:: <NAME> <<EMAIL>>, Yale University """ import os import subprocess import logging logger = logging.getLogger(__name__) # Web...
StarcoderdataPython
9740296
<reponame>chachabooboo/king-phisher #!/usr/bin/env python # -*- coding: utf-8 -*- # # tests/server/database/validation.py # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must ...
StarcoderdataPython
12806369
<gh_stars>10-100 from os.path import join, realpath import sys; sys.path.insert(0, realpath(join(__file__, "../../../../"))) import unittest from decimal import Decimal from hummingbot.strategy.amm_arb import utils from hummingbot.connector.connector_base import ConnectorBase from hummingbot.strategy.market_trading_pa...
StarcoderdataPython
6574953
# Cite from https://github.com/metrofun/E3D-LSTM from functools import reduce import copy import operator import torch import torch.nn as nn import torch.nn.functional as F from .rnn_cell import E3DLSTMCell, ConvDeconv3d from .utils import window from tqdm import tqdm import numpy as np class E3DLSTM_Module(nn.Module...
StarcoderdataPython
1837407
<gh_stars>1-10 import os from flask import Flask from rss_reader.config import Config from rss_reader.models import db, RssSource sources = [{ 'url': 'http://feed.cnblogs.com/blog/u/118754/rss', 'img': '1.jpg', 'name': 'Vamei', 'tag': 'Python', 'desc': '编程,数学,设计' }, { 'url': 'http://www.dongw...
StarcoderdataPython
3485847
#!/usr/bin/env python # -*- coding: utf-8 -*- # This is used in fstat_pdf_gen.py to generate the plots that are to be in the PDF. import json, time, urllib, os import unicodedata #Plotting libs import plotly import plotly.graph_objs as go from adrian_code.colour_science import SCILIFE_COLOURS, FACILITY_USER_AFFILIAT...
StarcoderdataPython
11375248
<gh_stars>1-10 # from flask import Flask, jsonify, request # from settings import SETTINGS # from db import db, Activity, Claim, Tag # from datetime import datetime # from flask_cors import CORS # from dateutil import parser # import pytz # # import iso8601 # # basedir = os.path.abspath(os.path.dirname(__file__)) # ap...
StarcoderdataPython
3267931
""" python-v2x.py Sample Mcity OCTANE Python script for interacting with V2X AACE data. """ import os import json from dotenv import load_dotenv import socketio import requests #Load environment variables load_dotenv() api_key = os.environ.get('MCITY_OCTANE_KEY', None) server = os.environ.get('MCITY_OCTANE_SERVER', '...
StarcoderdataPython
3531109
<reponame>shkyler/gmit-foda-trials<filename>Week 02/monty.py #Monty Hall Game - <NAME> 2018-10-02 - created for fun based on this problem https://en.wikipedia.org/wiki/Monty_Hall_problem import numpy as np # Set up the 3 doors and randomly put a car behind one of them doors = ['green', 'blue', 'red'] car = np.ra...
StarcoderdataPython
5060116
import os import cv2 import sys import argparse import numpy as np import matplotlib.pyplot as plt import warnings from PIL import Image warnings.filterwarnings('ignore') import torch.utils.data from backbone import mobilefacenet, resnet, arcfacenet, cbam from mtcnnalign.align_faces import warp_and_crop_face, get_refe...
StarcoderdataPython
6594299
<reponame>rpg711/Interview-Prep '''https://practice.geeksforgeeks.org/problems/equilibrium-point/0''' def find_equilibrium(A): if len(A) < 3: return -1 sum_before = A[0] sum_after = sum(A) - A[1] - A[0] idx = 1 # the equilibrium point if sum_before == sum_after: return idx w...
StarcoderdataPython
5191325
from sklearn.linear_model import LinearRegression import pandas as pd df=pd.read_csv("corrected_data4.csv") #Converting values to numeric df["price"]=pd.to_numeric(df["price"],errors='coerce') df["highway-mpg"]=pd.to_numeric(df["price"],errors='coerce') #declaring class of LinearRegression lm=LinearRegression() #fit...
StarcoderdataPython
9648157
<filename>examples/erm_data/erm_test.py<gh_stars>0 # This script uses LDLite to extract sample data from the FOLIO demo sites. # Demo sites current_release = 'https://folio-juniper-okapi.dev.folio.org/' latest_snapshot = 'https://folio-snapshot-okapi.dev.folio.org/' ldp_test = 'https://folio-test.ub.uni-mainz.de/okapi...
StarcoderdataPython
357427
from datetime import date d_maior = 0 for c in range(1, 8): ano = int(input('Insira o seu ano de nascimento:')) idade = date.today().year - ano if idade >= 21: d_maior = d_maior + 1 d_menor = 7 - d_maior print(f'Neses grupo de pessoas {d_maior} atingiram a maioridade e {d_menor} não.')
StarcoderdataPython
8163021
import logging, unittest from main import Url class UrlTest(unittest.TestCase): def test_sane_domain(self): url = Url('google.com') self.assertEqual('google.com', url.original_domain) self.assertEqual('http://google.com', url.domain) def test_domain_with_http(self): url = Url('http://google.co...
StarcoderdataPython
12802757
<gh_stars>10-100 #!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import unittest from fbpcp.util.gcspath import GCSPath class TestGCSPath(unittest.TestCase): ...
StarcoderdataPython
11311855
#!/usr/bin/python ## dinucleotide frequencies from seqeunces, input is multi sequence fasta format; import gzip import os import sys import re def dinuc_list(sequence): l1 = re.findall('.{1,2}', sequence) l2 = re.findall('.{1,2}', sequence[1:]) sequence_list = l1 + l2 return sequence_list def dinuc_counts...
StarcoderdataPython
6650512
<gh_stars>1-10 import re try: from Tkinter import * # noqa from tkMessageBox import showinfo, showerror except: from tkinter import * # noqa from tkinter.messagebox import showinfo, showerror import mudclientproto as mcp from mcpgui.wizard import Wizard from mcpgui.notebook import NoteBook class M...
StarcoderdataPython
1839278
<reponame>teuben/QAC<gh_stars>0 # -*- python -*- # # Typical usage (see also Makefile) # casa -c sky1.py # # Play with the skymodel # - one or full pointing set # - options for tp2vis, feather, ssc # # Reminder: at 115 GHz we have: # 12m PB is 50" (FWHM) [FWHM" ~ 600/DishDiam] # 7m PB is ...
StarcoderdataPython
1918944
from django.contrib.auth.forms import PasswordResetForm from django.contrib.auth.forms import UserChangeForm from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.forms import UsernameField from django.contrib.auth.models import User from django.forms import ModelForm, Form, ChoiceField, Integ...
StarcoderdataPython
1962709
<reponame>punitvara/daily-practice-DSA import os # directory = "Day "+i parent_dir = "./" # for i in range(100): # os.makedirs() for i in range(100): directory = "Day "+str(i) path = os.path.join(parent_dir, directory) print (path) if not os.path.exists(path): os.mkdir(path)
StarcoderdataPython
5026721
import django.contrib.auth.urls from django.urls import path, include from . import views urlpatterns = [ path( 'detail/<int:pk>', views.ProjectDetailView.as_view(), name='project_detail', ), path( 'create/', views.ProjectCreateVi...
StarcoderdataPython
1725100
from __future__ import absolute_import import os import sys import numpy as np from my_lib import Object from my_lib import Object2 from my_lib import Object3 from third_party import lib1 from third_party import lib2 from third_party import lib3 from third_party import lib4 from third_party import lib5 from third_pa...
StarcoderdataPython
9764842
from __future__ import absolute_import, division, unicode_literals locations = { 'urls_file': 'https://raw.githubusercontent.com/stephensolis/kameris-experiments/master/files.yml' # NOQA }
StarcoderdataPython
375468
<filename>translate_description.py #!/usr/bin/env python3 from json import dump, load from os.path import isfile from subprocess import run import sys class colors: BOLD = "\033[1m" HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' END = '\...
StarcoderdataPython
11379274
# coding:utf-8 import os import json from PIL import Image from django.core.paginator import Paginator from django.contrib import messages from django.contrib.auth import login as auth_login from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.models import User from django.contrib.auth.de...
StarcoderdataPython
11221636
<reponame>Practical-Formal-Methods/clam-racetrack #!/usr/bin/env python3.7 # Copyright 2019, Gurobi Optimization, LLC # In this example we show the use of general constraints for modeling # some common expressions. We use as an example a SAT-problem where we # want to see if it is possible to satisfy at least four (o...
StarcoderdataPython
130005
<gh_stars>0 from datetime import datetime import matplotlib.pyplot as plt import pandas as pd import pvlib latitude = -23.313602 longitude = -46.221382 altitude = 655 tmz = 'America/Sao_Paulo' temperatura = 20 pressao = 94000 agora = datetime.now() dia = agora.today().day mes = agora.today().month ano = agora.toda...
StarcoderdataPython
1746097
import torch import math from Net import ActorCritic from Utils import buffer class PPOAgent(): def __init__(self, state_dim, action_dim, gamma, std, eps_clip, kepoch, lr, device): self.gamma = gamma self.std = std self.eps_clip = eps_clip self.kepoch = kepoch self.device = ...
StarcoderdataPython
236041
<reponame>RetailMeNotSandbox/dart from dart.model.base import BaseModel, dictable @dictable class ApiKey(BaseModel): def __init__(self, id, user_id, api_key, api_secret): """ :type user_id: str :type api_key: str :type api_secret: str """ self.id = id self.us...
StarcoderdataPython
4826556
#! /usr/bin/env python3 # We need this to define our package from setuptools import setup # We use this to find and deploy our unittests import unittest import os # We need to know the version to backfill some dependencies from sys import version_info, exit # Define our list of installation dependencies DEPENDS = ["p...
StarcoderdataPython
251974
import pandas as pd import numpy as np import pylab as plt import seaborn as sns from sklearn import neighbors from scipy.cluster import hierarchy from scipy.spatial import distance from scipy.spatial.distance import squareform,pdist def one_nn_class_baseline(X,labels): ''' given a pointcloud X and labels, compute...
StarcoderdataPython
103620
# -*- Mode:Python;indent-tabs-mode:nil; -*- # # File: psaExceptions.py # Created: 05/09/2014 # Author: BSC # # Description: # Custom execption class to manage error in the PSC # class psaExceptions( object ): class confRetrievalFailed( Exception ): pass
StarcoderdataPython
9684143
from __future__ import absolute_import, division, print_function import datetime import os import gzip import os import json from contextlib import contextmanager import numpy as np from odo.backends.json import json_dumps from odo.utils import tmpfile, ignoring from odo import odo, discover, JSONLines, resource, JS...
StarcoderdataPython
1753503
<filename>modeling_script.py<gh_stars>0 import os import glob import pandas as pd import argparse def args(): parser = argparse.ArgumentParser() parser.add_argument("-f", "--folder", required=True, help="Enter into the folder") parser.add_argument("-omega", "--omega_path", required=Tru...
StarcoderdataPython
1808761
<reponame>seigot/tetris_game_tutorial #for x in [1,2,3,4]: print("for x in [1,2,3,4]:") for x in [1,2,3,4]: print (x)
StarcoderdataPython
1705076
<reponame>Rey092/SwipeApp from django.contrib import admin from src.estate.models import Advertisement, Complex from src.users.models import Contact admin.site.register(Advertisement) admin.site.register(Complex)
StarcoderdataPython
1605135
from ... import UP, DOWN, LEFT, RIGHT, UP_2, DOWN_2, LEFT_2, RIGHT_2 class Movable: move_up = UP move_up_alt = UP_2 move_down = DOWN move_down_alt = DOWN_2 move_left = LEFT move_left_alt = LEFT_2 move_right = RIGHT move_right_alt = RIGHT_2 lr_step = 1 ud_step = 1 wrap_hei...
StarcoderdataPython
11329269
<gh_stars>0 a, b, c = input().split() a, b, c = int(a), int(b), int(c) divisible = 0 for i in range(a, b+1): if i % c == 0: divisible += 1 print(divisible)
StarcoderdataPython
214660
import re import os import pathlib from xml.dom import minidom from xml.sax.saxutils import escape from xml.parsers.expat import ExpatError class Transcribe(): COMMENT = '<!--TEMPLATE-->' SECTION_START = '<div style="border: 1px solid #EBECF0; margin-bottom: 10px;">' SECTION_END = '</div>' RECORDED_HE...
StarcoderdataPython
1731284
from Messenger import Messenger msg = Messenger() msg.send_error_message('Error message 301')
StarcoderdataPython
11316169
def getfield(glyph, key): import re nwl = re.compile('\r?\n') field = re.compile(r'^\s*([\w\-]+)\s*:\s*(.+?)\s*$') rawlist = nwl.split(glyph.comment) fields = {} for line in rawlist: (name, value) = field.match(line).group(1, 2) fields[name] = value return fields[key]
StarcoderdataPython
292213
<filename>telethon/tl/types/messages.py<gh_stars>0 """File generated by TLObjects' generator. All changes will be ERASED""" from ...tl.tlobject import TLObject from typing import Optional, List, Union, TYPE_CHECKING import os import struct if TYPE_CHECKING: from ...tl.types import TypeEncryptedFile, TypeChat, TypeS...
StarcoderdataPython
3429820
# Copyright 2013 OpenStack Foundation # # 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 ...
StarcoderdataPython
1870780
<gh_stars>1-10 # SPDX-FileCopyrightText: Copyright 2022-present Open Networking Foundation. # SPDX-License-Identifier: Apache-2.0 from scapy.contrib.gtp import GTP_U_Header, GTPPDUSessionContainer from scapy.layers.inet import IP, UDP from scapy.layers.l2 import Ether GTPU_PORT = 2152 def pkt_add_gtpu( pkt, ...
StarcoderdataPython
6538119
<gh_stars>1-10 # 20200517 Angold4 import os class Computer: def __init__(self, name): self._name = name self._storage = [] self._addrstorage = [] def get_name(self): return self._name def recieved(self, packages, path): if packages not in self._storage: ...
StarcoderdataPython
9687032
from swsscommon import swsscommon import os import sys import time import json import pytest from distutils.version import StrictVersion def create_entry(tbl, key, pairs): fvs = swsscommon.FieldValuePairs(pairs) tbl.set(key, fvs) # FIXME: better to wait until DB create them time.sleep(1) def remove_e...
StarcoderdataPython
9722748
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
StarcoderdataPython
6479687
<gh_stars>0 #!/usr/bin/env python3 import argparse parser = argparse.ArgumentParser(description='Druckfedern') parser.add_argument('-d', type=float, help='Drahtdurchmesser') parser.add_argument('-D', type=float, help='Áussendurchmesser') parser.add_argument('-n', type=float, help='Windungen') parser.add_argument('-L',...
StarcoderdataPython
3580595
#!/usr/bin/env python3 import argparse import os from os import path import pandas as pd from cobra.io import read_sbml_model, write_sbml_model from cobra.util import solvers from corda import CORDA from corda.util import reaction_confidence from fastcore import Fastcore from csm4cobra.io import read_json from csm4co...
StarcoderdataPython
132403
<reponame>LuckyMagpie/StatusMap from django.contrib import admin from .models import * admin.site.register(StatusPoint) admin.site.register(Indicator) # Register your models here.
StarcoderdataPython
4927102
<gh_stars>1-10 # Enter your code here. Read input from STDIN. Print output to STDOUT a = float(raw_input()) b = float(raw_input()) print(int(a//b)) print(a/b)
StarcoderdataPython
11328795
ies = [] ies.append({ "iei" : "2D", "value" : "Authentication response parameter", "type" : "Authentication response parameter", "reference" : "172.16.58.3", "presence" : "O", "format" : "TLV", "length" : "6-18"}) ies.append({ "iei" : "78", "value" : "EAP message", "type" : "EAP message", "reference" : "192.168.3.11", ...
StarcoderdataPython
1765082
#!/usr/bin/env python # Copyright (c) 2016 Hewlett Packard Enterprise Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
StarcoderdataPython
118557
<reponame>dwward/kb-syllabus ''' Utility to assist in converting CSV format of Kaiwan Syllabus to a technique list. Expects CSV format in a particular format that requires the Excel spreadsheet to be altered according to example below. Example ------------- THROWING TECHNIQUES (NAGE WAZA),...
StarcoderdataPython
31007
import numpy as np import tensorflow as tf from tensorflow import keras from keras.applications.xception import Xception import h5py import json import cv2 import math import logging from tensorflow.keras.preprocessing import image from tensorflow.keras.applications.xception import preprocess_input, decode_pr...
StarcoderdataPython
9658489
#!/usr/bin/python3 # -*- coding: utf-8 -*- ##===-----------------------------------------------------------------------------*- Python -*-===## ## _ ## | | ## __| | __ ___ ___ ___ ## ...
StarcoderdataPython
6610743
"""Initialize CommissioningIssues into database.""" import re import os import copy import github3 import logging # noqa import numpy as np import pandas as pd from astropy.time import Time from dateutil import parser as dateparser from datetime import datetime, timedelta from django.core.management.base import BaseC...
StarcoderdataPython
1969462
from .queue import Queue class AnimalShelter: """ AnimalShelter class""" def __init__(self): self.pseudo_queue = Queue() self._length = 0 def enqueue(self, obj): """ add either a dog or cat object """ self.pseudo_queue.enqueue(obj) self._length += 1 def dequeu...
StarcoderdataPython
11211014
# Copyright (c) 2015 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to the S...
StarcoderdataPython
3442124
<reponame>trickeydan/mqtt-automate """MQTT Automate API.""" import argparse import asyncio import logging from pathlib import Path from typing import Callable, Dict, Match, Optional from .engine import AutomationEngine, OnMessageHandler from .mqtt import Topic loop = asyncio.get_event_loop() LOGGER = logging.getLogge...
StarcoderdataPython
6681969
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import utool as ut import re from itertools import combinations #import sys print, rrr, profile = ut.inject2(__name__, '[rules]') # TODO: remove static class. just use the module #INF = sys.maxint #HAS_NUMPY = F...
StarcoderdataPython
48663
from django import forms class UserForm(forms.Form): name = forms.CharField(max_length=30) email = forms.CharField(max_length=30, widget = forms.EmailInput) password = forms.CharField(widget = forms.PasswordInput) class Meta: fields = ['name', 'email', 'password'] # class HandlerForm(forms....
StarcoderdataPython
11258245
import gzip import codecs import json import pickle from typing import Any, Iterator, Callable, Iterable import xmltodict def load_xml_gz(filename: str, func: Callable, depth: int) -> Any: with gzip.open(filename) as f: return xmltodict.parse(f, item_depth=depth, item_callback=func) def load_xml(filena...
StarcoderdataPython
1856230
<reponame>WatsonWangZh/CodingPractice # Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. # Example 1: # Input: a = 1, b = 2 # Output: 3 # Example 2: # Input: a = -2, b = 3 # Output: 1 class Solution(object): def getSum(self, a, b): """ :type a: int ...
StarcoderdataPython
1887968
<filename>src/service/tasks/__init__.py # encoding: utf-8 from .tasks import *
StarcoderdataPython
5078633
# Copyright 2019 NEC 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
StarcoderdataPython
3521757
from .resnet101_baseline import get_resnet101_baseline from .resnet101_base_oc import get_resnet101_base_oc_dsn from .resnet101_pyramid_oc import get_resnet101_pyramid_oc_dsn from .resnet101_asp_oc import get_resnet101_asp_oc_dsn from .resnet101_aa_dsn import get_resnet101_aa_dsn networks = { 'resnet101_b...
StarcoderdataPython
5103354
<reponame>Ace-Ma/LSOracle import argparse import sys import glob import math import numpy as np import os import shutil import subprocess import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import re import time import timeit from datetime import datetime import logging #Set up command line parser ...
StarcoderdataPython
5126184
from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseNotFound, HttpResponseNotAllowed import gripcontrol import smartfeed import smartfeed.django def items(req, **kwargs): if req.method == 'GET': mapper_class = kwargs.get('mapper_class') if mapper_class: mapper = smartfeed.django.get_class...
StarcoderdataPython
3349273
<filename>Algo_practice/BinaryGap.py # you can write to stdout for debugging purposes, e.g. # print("this is a debug message") ''' A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N. For example, number 9 has ...
StarcoderdataPython
3468577
# 学号:1827402018 # 姓名:王浩南 # IP:192.168.157.238 # 上传时间:2018/11/12 15:19:26 import math def func1(a,b): #请输入两个整数a和b if a>=b: a,b=b,a #引入一个量c c=1 while a<=b: c=c*a a+=1 count=0 if c%10!=0: return None else: while c%10==0: count+=1 ...
StarcoderdataPython
8068806
# In this example, which is a variation of 'node_setup.py', # dispy's "resetup_node" method is used to replace in-memory data to illustrate # how to change working dataset. Although "resetup_node" feature can be used # with any platform, this example doesn't work with Windows, as in-memory # feature doesn't work with W...
StarcoderdataPython
4952714
from scrapy.spiders import Spider from scrapy.selector import Selector from scrapy.loader import ItemLoader from scrapy.loader.processors import Join, MapCompose from scraper_app.items import LivingSocialDeal class LivingSocialSpider(Spider): """Spider for regularly updated livingsocial.com site, Austin Page""" ...
StarcoderdataPython
11359051
<gh_stars>10-100 size(800, 800) background(255) noStroke() # Größe pro Kästchen size = 20 # Gehe alle Spalten durch for y in range(0, height / size): # Gehe alle Zeilen durch for x in range(0, width / size): # Zufällige Füllfarbe fill(random(0, 255), random(0, 255), random(0, 255)) # ...
StarcoderdataPython
3501129
<gh_stars>10-100 import requests from mockserver_friendly import request, response, times from test import MOCK_SERVER_URL, MockServerClientTestCase class TestBasicVerifying(MockServerClientTestCase): def test_verify_request_received_once(self): self.client.stub(request(), response()) requests.get...
StarcoderdataPython