id stringlengths 1 7 | text stringlengths 6 1.03M | dataset_id stringclasses 1
value |
|---|---|---|
158667 | <reponame>kdvalin/benchmark-wrapper
#!/usr/bin/env python
# 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 |
4852 | <filename>google-datacatalog-apache-atlas-connector/src/google/datacatalog_connectors/apache_atlas/scrape/metadata_scraper.py
#!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may o... | StarcoderdataPython |
12554 | <gh_stars>1-10
import nest
import pylab as pl
import pickle
from nest import voltage_trace
from nest import raster_plot as rplt
import numpy as np
from params import *
seed = [np.random.randint(0, 9999999)] * num_threads
def calcFI():
#amplitudesList = np.arange(3.5,4.5,0.1)
amplitudesList = np.arange(100,... | StarcoderdataPython |
171753 | """
==== KEY POINTS ====
- Given a fixed length array arr of integers, duplicate each occurrence of zero, shifting the remaining elements to the right.
- Do the above modifications to the input array in place, do not return anything from your function.
- arr.length <= 10000
- arr[i] <= 9
"""
"""
==== BRUTE FORCE SOL... | StarcoderdataPython |
3282732 | f1 = open('/bin/ls', 'rb')
f2 = open('/root/ls', 'wb')
data = f1.read()
f2.write(data)
f1.close()
f2.close()
| StarcoderdataPython |
3272527 | """
Config module
This module defines the class for getting configuration options
:license: MIT, see LICENSE for more details
:copyright: (c) 2016 by NETHINKS GmbH, see AUTORS for more details
"""
import os
import configparser
class AppConfig(object):
def __init__(self, config_file=None):
# get directory... | StarcoderdataPython |
3255020 | import phonenumbers
from id_phonenumbers.data import (AREA_CODE, CDMA_PREFIXES,
GSM_PREFIXES, MOBILE_CDMA_PREFIXES)
class Number(object):
def __init__(self, phone):
self.phone = phone
self._phone = phonenumbers.parse(self.phone, "ID")
self.national_numb... | StarcoderdataPython |
1602083 | <reponame>xorllc/emnes<gh_stars>1-10
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2019 <NAME>
#
# See LICENSE at the root of this project for more info.
"""EmNES emulator.
Usage:
emnes <path-to-rom> [--no-vsync | --no-rendering] [--nb-seconds=<n>] [--no-jit-warmup]
Options:
-h --help Sho... | StarcoderdataPython |
131987 | # Copyright 2018 Canonical Ltd
#
# 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 writing, s... | StarcoderdataPython |
1741313 | <gh_stars>0
import os
import argparse
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from astropy.time import Time
import astropy.units as u
from zchecker import ZChecker
parser = argparse.ArgumentParser(
description='Plot ZTF pointing and found targets.')
parser.add_arg... | StarcoderdataPython |
3298839 | <gh_stars>0
# Generated by Django 3.1.3 on 2020-11-12 09:06
import cloudinary.models
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Member',
fields=[
... | StarcoderdataPython |
3384482 | import dataclasses
import datetime
@dataclasses.dataclass
class Event:
id: int
user: str
title: str
quantity: int
done_at: datetime
due_at: datetime
remind_at: datetime
status: str
type_id: int
def __init__(self, props):
self.id = props.get('id')
self.user = pro... | StarcoderdataPython |
1781919 | from zipfile import ZipFile
from urllib.request import urlretrieve
from urllib import error
import pandas as pd
import urllib
import os
import seaborn as sns
import matplotlib.pyplot as plt
def download_zip():
"""download openpowerlifting data (~77mb) and store in this .py file's directory (default path)"""
t... | StarcoderdataPython |
1794797 | from feeds.tests.test_latest import *
| StarcoderdataPython |
93075 | <reponame>overholts/tuner
import os
import shutil
from pathlib import Path
def copy(source: Path, destination: Path):
os.makedirs(destination.parent, 0o755, exist_ok=True)
shutil.copy(str(source), str(destination))
def remove(target: Path):
os.remove(target)
| StarcoderdataPython |
3207058 | #!/usr/bin/env python
"""
A Python scrpipt to create QFED Level 2b files.
"""
import warnings
warnings.simplefilter('ignore',DeprecationWarning)
import os
import sys
from numpy import median, savez
from optparse import OptionParser # Command-line args
import qfed
#--------------------------------------... | StarcoderdataPython |
1698671 | import torch
import torch.nn as nn
import torch.nn.functional as F
def unfold1d(x, kernel_size, padding_l, pad_value=0):
'''
unfold T x B x C to T x B x C x K
:param x: [src_len, batch_size, hid_dim]
:param kernel_size:
:param padding_l:
:param pad_value:
:return:
'''
if kernel_size... | StarcoderdataPython |
3251982 | <reponame>Matt-Crow/SmallPythonPrograms
"""
<NAME>
"""
from socket import *
import os.path
import re
SERVER_HOST = "localhost"
SERVER_PORT = 5139
SERVER_ADDR = (SERVER_HOST, SERVER_PORT)
BUFFER_SIZE = 4096
def startWebServer():
WebServer(SERVER_ADDR).start()
class WebServer:
def __init__(self, address... | StarcoderdataPython |
185626 | <reponame>dcalacci/weclocked
from conftest import client
from pathlib import Path
resources = Path(__file__).parent / "resources"
def test_upload_csv_returns_response(client):
resp = client.post("/exports/upload/", data={
"name": "file",
"file": (resources / "... | StarcoderdataPython |
193720 | from traceback import format_exception
from datetime import datetime
from textwrap import indent
import logging
class RPCHandler(logging.Handler):
def __init__(self, rpc, log_level_name, *args, **kwargs):
super().__init__(*args, **kwargs)
self.rpc = rpc
self.buffer = []
self.buffe... | StarcoderdataPython |
91544 | <reponame>uummoo/samplyser
from samplyser import pitch
from samplyser import duration
from samplyser import amplitude
from samplyser import spectrum
from samplyser.analyse import *
| StarcoderdataPython |
4840739 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import subprocess
import gdb
import pwndbg.arch
import pwndbg.color.memory as M
import pwndbg.commands
import pwndbg.config
import pwndbg.memory
import pwndbg.regs
import pwndbg.stack
import pwndbg.vmmap
import pwndbg.wrappers
parser = arg... | StarcoderdataPython |
103194 | # ======================================================================================================================
# File: Tests/Model/MeasureableUnits/test_SpecificVolumeType.py
# Project: AlphaBrew
# Description: Test cases for the SpecificVolumeType measureable unit
# Author: <NAME> <<E... | StarcoderdataPython |
1715024 | import neo4j
import configparser
FIND_NEW_DATASETS_Q = "match (ds:Entity {entitytype:'Dataset'})-[:HAS_METADATA]->(m:Metadata) where m.status = 'New' return m.data_types as data_types, m.provenance_group_name as organization, ds.uuid as uuid, ds.hubmap_identifier as hubmap_id"
config = configparser.ConfigParser()
con... | StarcoderdataPython |
3397314 | # -*- coding: utf-8 -*-
import allure
from model.group import Group
import pytest
def test_add_group(app, db, json_groups, check_ui):
group = json_groups
group_list = my_step_1(app, db)
my_step_2(app, group)
my_step_3(app, check_ui, db, group, group_list)
@allure.step("Given a group list")
def my_ste... | StarcoderdataPython |
59232 | <reponame>zliobaite/redescription-China
import re, string, numpy, codecs, itertools, os.path
from classQuery import SYM
from classSParts import SSetts, tool_ratio
import pdb
SIDE_CHARS = {0:"L", 1:"R", -1: "C"}
HAND_SIDE = {"LHS": 0, "RHS": 1, "0": 0, "1": 1, "COND": -1, "-1": -1}
NUM_CHARS = dict([(numpy.base_repr(ii... | StarcoderdataPython |
3257232 | '''A neural network used to predict future internal peptide coordinates.'''
import keras
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from keras.layers import Dense, Input, LSTM
from keras.models import Sequential
class Predictors():
'''A basic feed-forward neural net to predict futu... | StarcoderdataPython |
24005 | # Copyright (c) 2020-2021, <NAME>
# License: MIT License
from typing import (
TYPE_CHECKING,
List,
Iterable,
Tuple,
Optional,
Dict,
Sequence,
)
import math
import itertools
from ezdxf.math import (
Vec3,
Z_AXIS,
OCS,
Matrix44,
BoundingBox,
ConstructionEllipse,
cu... | StarcoderdataPython |
1632039 | # Copyright (c) 2011 - 2017, Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | StarcoderdataPython |
1780449 | <filename>pyopenproject/business/query_service.py
from abc import ABCMeta, abstractmethod
from pyopenproject.business.abstract_service import AbstractService
class QueryService(AbstractService):
"""
Class QueryService,
service for query endpoint
"""
__metaclass__ = ABCMeta
def __init__(self,... | StarcoderdataPython |
3365048 | #!/usr/bin/env python
from pytest import approx
import pytest
from datetime import datetime
import hwm93
def test_hwm():
t = datetime(2013, 3, 31, 12)
glat = 65
glon = -148
altkm = 150
f107a = 100
f107 = 100
ap = 4
wind = hwm93.run(t, altkm, glat, glon, f107a, f107, ap)
assert wi... | StarcoderdataPython |
3347940 | <gh_stars>0
#!/usr/bin/env python
with open('input') as input_file:
input = input_file.read()
x = 0
y = 0
presents = {(x, y): 1}
for move in input:
if move == '^':
y += 1
elif move == 'v':
y -= 1
elif move == '<':
x -= 1
elif move == '>':
x += 1
else:
... | StarcoderdataPython |
175226 | <reponame>jordiprats/django-ampa
from django.forms import ModelForm
from django import forms
from peticions.models import *
class IssueFilterForm(forms.Form):
status_filter = forms.ChoiceField(choices=ISSUE_STATUS, required = False)
def __init__(self, data, **kwargs):
initial = kwargs.get('initial', ... | StarcoderdataPython |
3297369 | <filename>SnakeNest/scripts/Common_unitigs.py<gh_stars>10-100
#!/usr/bin/env python
# FIXME this one needs refactoring and factoring out the hardcoded paths
# FIXME normalize names and spaces
from __future__ import print_function
import re
import sys
import glob
import argparse
from os.path import basename, join, dirn... | StarcoderdataPython |
3348622 | from example1b import from_dollars, Item, from_item_quantities
def test_total_over_100_gives_five_percent_discount():
itemA = Item("A", from_dollars(10.0))
itemB = Item("B", from_dollars(25.0))
itemC = Item("C", from_dollars(9.99))
basket = from_item_quantities(
(itemA, 5),
(itemB, 2),... | StarcoderdataPython |
143165 | <gh_stars>0
from py_hcl.utils import json_serialize
@json_serialize(json_fields=['stmt_class', 'statement'])
class LineStatement(object):
def __init__(self, scope_id, statement):
self.stmt_class = 'line'
self.scope_id = scope_id
self.statement = statement
@json_serialize(json_fields=['st... | StarcoderdataPython |
1756040 | <gh_stars>0
#!/usr/bin/python
from setuptools import setup, find_packages
def read_readme():
with open('README.md', 'r') as f:
return f.read()
setup(
name='pokermon',
version='0.0.1',
url='https://github.com/jackarailo/pokermon',
packages=find_packages(),
test_require=[],
... | StarcoderdataPython |
1726183 | <reponame>franloza/ETS-Challenge
"""diagnostics.py
Some methods to plot diagnostics.
Author: <NAME> <<EMAIL>>
"""
import matplotlib.pyplot as plt
from sklearn.metrics import hinge_loss
def plot_roc(fpr, tpr):
"""Plot ROC curve and display it."""
plt.clf()
plt.plot(fpr, tpr)
plt.plot([0, 1], [0, 1],... | StarcoderdataPython |
1605487 | # -*- coding: utf8 -*-
import gzip
import zlib
from contextlib import contextmanager
from requests import Session
from google_ngram_downloader.__main__ import download, cooccurrence, readline
from google_ngram_downloader import util
import pytest
@pytest.fixture
def compressobj():
return zlib.compressobj()
@... | StarcoderdataPython |
161493 | <reponame>Chromico/bk-base<filename>src/api/datamanage/pro/datastocktake/dataset_process.py
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed unde... | StarcoderdataPython |
1707902 | #!/usr/bin/python3
"""Generates extension wrapper for gl functions."""
class GeneratorData:
def __init__(self):
self.XML = "gl.xml"
self.DESTHPP = "./neutrino/graphics/src/opengl/opengl.hpp"
self.DESTCPP = "./neutrino/graphics/src/opengl/opengl.cpp"
self.API = "gl"
self.S... | StarcoderdataPython |
121535 | <filename>1 Diving in python/Homework/1 Intro to python/stairs.py
import sys
if __name__ == "__main__":
num_of_stairs = int(sys.argv[1])
stairs = [' '] * num_of_stairs
for i in range(1, num_of_stairs+1):
stairs[-i] = '#'
print(''.join(stairs))
| StarcoderdataPython |
1699045 | <filename>Pandas/Data Sciensist/pivot-tables.py
#/usr/bin/env python3
import numpy as np
import pandas as pd
from seaborn import load_dataset
import matplotlib.pyplot as plt
def pivot():
#podemo usar pivot para mostrar una mejor vista
#pibot usala funcion de agregado mean() por defecto en aggfunc='mean'
d... | StarcoderdataPython |
3296166 |
from collections import defaultdict
# Dual-operand type matching cube
dual_cube = {
'int': {
'int': {
'=': 'int',
'+': 'int',
'-': 'int',
'*': 'int',
'/': 'int',
'%': 'int',
'.': 'int',
'<': 'bool',
'<=': 'bool',
'>': 'bool',
'>=': 'bool',
... | StarcoderdataPython |
3249832 | """
Runs the text detector algorithm, getting low-level texture-detection returns; passes on
list of detected and undetected windows that can be used with the ground truth ROIs to
generate ROC curves.
"""
import rigor.runner
import argparse
from shapely.geometry import Polygon
parameters = {
"pyramid_step": 2,
"p... | StarcoderdataPython |
4557 | from flask_restful import reqparse
def retornar_parser():
parser = reqparse.RequestParser()
parser.add_argument('sentenca', type=str, required=True)
return parser
| StarcoderdataPython |
29521 | <reponame>rawheel/Django-User-Management-System<gh_stars>1-10
from django.shortcuts import render,redirect
from .forms import UserForm,RoleForm,RightsForm
from .models import UserTable,UserRole,UserRights
def show_users(request):
if request.method == "GET":
users = list(UserTable.objects.values_list('user_n... | StarcoderdataPython |
177007 | from collections import defaultdict
from math import *
from itertools import product
from logbook import Logger
import cv2
import numpy as np
import networkx as nx
import math
from tqdm import tqdm
# from palettable.cartocolors.qualitative import Pastel_10 as COLORS
from suppose.common import timing
from suppose.camer... | StarcoderdataPython |
54500 | #!/usr/bin/env python
"""
$ python main.py 3
906609 = 913 * 993
"""
import sys
from math import sqrt
def is_palindrome(i):
return str(i) == str(i)[::-1]
def get_divisors(i):
for j in range(1, 1 + int(sqrt(i))):
if i % j == 0:
yield j, i // j
def find_palindrome(digits):
for i in ... | StarcoderdataPython |
1656366 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
import functools
from functools import partial
from decimal import Decimal
from uuid import UUID
import logging
import os
import sys
from collections import Iterable, Sized
from itertools import chain
import django
from dja... | StarcoderdataPython |
169743 | from django.apps import AppConfig
class InternXplorerConfig(AppConfig):
name = 'intern_xplorer'
| StarcoderdataPython |
3396474 | <reponame>LeDuySon/fast-reid-uet<filename>demo/group_id.py
import argparse
from collections import defaultdict
import os
import glob
import shutil
def construct_group(key, members, save_path):
scene, duration, obj_id = key.split("_")
save_path = os.path.join(save_path, scene, duration, obj_id)
if(not os.p... | StarcoderdataPython |
1615832 | <filename>scripts/train.py
"""
Copyright 2017-2018 Fizyr (https://fizyr.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/LICENSE-2.0
Unless required by appli... | StarcoderdataPython |
1788605 | <reponame>monacotime/dump_dump_dump
import random
#Hard Defined Values------------
mainList = []
currentChoice = 1
#Functions Defenations----------
def cRand():
randChoice = random.choice(mainList)
print(randChoice)
def exitQ():
print("Are you sure you want to quit?"
" [Y = Quit]"
... | StarcoderdataPython |
1716537 | <gh_stars>1-10
"""Update change rule API method."""
from ibsng.handler.handler import Handler
class updateChargeRule(Handler):
"""Update charge rule method class."""
def control(self):
"""Validate inputs after setup method.
:return: None
:rtype: None
"""
self.is_valid... | StarcoderdataPython |
4837264 | <filename>findatapy_examples/cryptocurrencies_example.py<gh_stars>0
__author__ = "saeedamen" # <NAME>
#
# Copyright 2016 Cuemacro
#
# 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.... | StarcoderdataPython |
3297421 | from setuptools import setup, find_packages
def read_file(fname):
with open(fname, 'r') as f:
return f.read()
setup(
name="tmuxer",
version='0.0.2',
author='<NAME>',
author_email='<EMAIL>',
description='Quick tool that creates tmux interfaces from a conf file',
long_description=rea... | StarcoderdataPython |
3285561 | class TreeNode(object):
""""""
def __init__(self, parent, child, content):
""""""
self.parent = parent
self.child = child
self.content = content
| StarcoderdataPython |
1770280 | from output.models.ms_data.datatypes.facets.positive_integer.positive_integer_min_inclusive003_xsd.positive_integer_min_inclusive003 import (
FooType,
Test,
)
__all__ = [
"FooType",
"Test",
]
| StarcoderdataPython |
151794 | <reponame>zhouyuanzhen/ZeroMCMP
#!/usr/bin/env python
# -*- coding: utf-8 -*-
if __name__ == '__main__':
print("************************************************************************")
print("* WELCOME TO ZEROMCMP (OpenSource MultiCloud Management Platform) *")
print("******************************... | StarcoderdataPython |
189615 | <filename>dbops_venv/lib/python3.5/site-packages/alembic/autogenerate/__init__.py
from .api import compare_metadata, _produce_migration_diffs, _produce_net_changes
| StarcoderdataPython |
3397016 | '''
Loads a trained model, and classifies an image
argv[1]: path to hdf5 model to load
argv[2]: path to image to classify
'''
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing.image import load_img, img_to_array, array_to_img
import sys
import time
import numpy as np
model = load_mo... | StarcoderdataPython |
4803539 | <reponame>GunnerJnr/_CodeInstitute
"""
Staging.py:
"""
from base import *
DEBUG = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Stripe environment variables
STRIPE_PUBLISHABLE = os.getenv('STRIPE_PUBLISHABLE', '... | StarcoderdataPython |
196908 | <gh_stars>10-100
from src.Generation.Decoding.Decoding import Decoder
import numpy as np
def demo_helper():
# decoder = Decoder.from_h5()
decoder = Decoder.from_single_vector(np.load("generated_notes.npy"), time="1/16")
decoder.set_time('1/16')
#decoder.play(0)
decoder.save_tune(0)
if __name__ ==... | StarcoderdataPython |
1692167 | # 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,... | StarcoderdataPython |
1728720 | <gh_stars>1-10
#!/usr/bin/python3
# @author S6ril & Starfunx
"""
Cette node permet de donner comme consigne de se diriger vers une succession de points définis dans un fichier `.txt`.
"""
import rospy
from geometry_msgs.msg import Twist, Pose2D
from math import sqrt, pow, atan2, cos, sin
from Nav_utiles import ... | StarcoderdataPython |
3399898 | <gh_stars>1000+
import pytest
import core.config
import modules.contrib.dunst
def build_module():
return modules.contrib.dunst.Module(
config=core.config.Config([]),
theme=None
)
def test_load_module():
__import__("modules.contrib.dunst")
def test_input_registration(mocker):
input_r... | StarcoderdataPython |
1722511 | <gh_stars>10-100
reg_list=[
# the higher bits of the table descriptor(the second list), from 59 to 63, are RES0 in Stage2
## lowerAttribute from NS to nG, upperAttribute from DBM or Contiguous to Ignored
## AP. access permission
## 4KB L0 does not support Block Descriptor
["Descriptor4KBL0","uint64_t","ANY_M... | StarcoderdataPython |
3382865 | <reponame>Kitware/ResonantGeoData<gh_stars>1-10
import factory
import factory.django
from rgd_imagery import models
from rgd_testing_utils.factories import ChecksumFileFactory
class ImageFactory(factory.django.DjangoModelFactory):
class Meta:
model = models.Image
file = factory.SubFactory(ChecksumFil... | StarcoderdataPython |
41578 | #
# Copyright (C) 2015 The Android Open Source Project
#
# 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 la... | StarcoderdataPython |
4814781 | from django.db import models
# definition of Tag model (template for all tags in database)
class Tag(models.Model):
# variable to store name of the tag - list of chars, max length 100 characters
tag_name = models.CharField(
'tag name',
max_length=100,
unique=True,
)
# variable t... | StarcoderdataPython |
3258079 | from django import forms
from .models import Category
class CategoryAdminForm(forms.ModelForm):
class Meta:
model = Category
fields = ['hierarchy', 'parent', 'name', 'slug', 'featured']
required_if_other_not_given = {
'hierarchy': 'parent',
'parent': 'hierarchy',
}
de... | StarcoderdataPython |
130994 | ##
# Copyright (c) 2006-2017 Apple 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 l... | StarcoderdataPython |
148647 | <gh_stars>0
# -*- coding: utf-8 -*-
from os.path import join
import matplotlib.pyplot as plt
from numpy import array, pi, zeros
from pyleecan.Classes.Frame import Frame
from pyleecan.Classes.LamSlotWind import LamSlotWind
from pyleecan.Classes.LamSquirrelCage import LamSquirrelCage
from pyleecan.Classes.MachineDFIM i... | StarcoderdataPython |
158597 | '''
Function:
train the model
Author:
<NAME>
'''
import os
import copy
import torch
import warnings
import argparse
import torch.nn as nn
import torch.distributed as dist
from modules import *
from cfgs import BuildConfig
warnings.filterwarnings('ignore')
'''parse arguments in command line'''
def parseArgs():... | StarcoderdataPython |
3217803 | <gh_stars>0
import os, sys
sys.path.append(os.path.dirname(__file__))
from common import *
from dataset.reader import *
#ensemble =======================================================
class Cluster(object):
def __init__(self):
super(Cluster, self).__init__()
self.members=[]
self.center... | StarcoderdataPython |
3316057 | import scholarly
import pandas as pd
from tqdm import tqdm
import time
search = scholarly.search_pubs_query('Machine learning in logistics')
author = []
title = []
abstract = []
date = []
url = []
eprint = []
date = []
for i in tqdm(range(400)):
publication = next(search)
# time.sleep(5)
# publication.fill(... | StarcoderdataPython |
4827539 | <reponame>edmundmk/ualyze
#!/usr/bin/env python3
#
# ucdtest.py
#
# Created by <NAME> on 31/05/2020.
# Copyright © 2020 <NAME>.
#
# Licensed under the ISC License. See LICENSE file in the project root for
# full license information.
#
#
# Tests ualyze against tests from the Unicode Character Database.
#
imp... | StarcoderdataPython |
60949 | import traceback
from pycompss.api.task import task
from pycompss.api.constraint import constraint
from pycompss.api.parameter import FILE_IN, FILE_OUT
from biobb_common.tools import file_utils as fu
from biobb_chemistry.acpype import acpype_params_gmx
@task(input_path=FILE_IN, output_path_gro=FILE_OUT, output_path_it... | StarcoderdataPython |
1633602 | <reponame>MrDelik/core
"""Fixtures for harmony tests."""
from unittest.mock import AsyncMock, MagicMock, PropertyMock, patch
from aioharmony.const import ClientCallbackType
import pytest
from homeassistant.components.harmony.const import ACTIVITY_POWER_OFF
from .const import NILE_TV_ACTIVITY_ID, PLAY_MUSIC_ACTIVITY_... | StarcoderdataPython |
104549 | <gh_stars>0
"""
Problem name: ThePalindrome
Class: SRM 428, Division II Level One
Description: https://community.topcoder.com/stat?c=problem_statement&pm=10182
"""
def solve(args):
""" Simply reverse the string and find a match. When the match is found,
continue it to the end. If the end is reached, th... | StarcoderdataPython |
13773 | <gh_stars>1-10
"""Class to echo credentials."""
from monzo.handlers.storage import Storage
class Echo(Storage):
"""Class that will echo out credentials."""
def store(
self,
access_token: str,
client_id: str,
client_secret: str,
expiry: int,
refresh_token: str =... | StarcoderdataPython |
1709336 | import os.path
import sys
import time
from .json_ops import JSONReaderWriter
class JSONSettings:
def __init__(self, program_path, default_settings):
#create settings reader, and check to make sure it exists
self.settings = JSONReaderWriter(program_path + os.path.sep + 'settings.JSON')
se... | StarcoderdataPython |
1787295 | # coding: utf-8
"""
Rumble API
Rumble Network Discovery API # noqa: E501
OpenAPI spec version: 2.11.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Organization(object):
"""NOTE: This class is a... | StarcoderdataPython |
160159 | """This is the main file called to run the flask application"""
from dotenv import load_dotenv
from root.factory import create_app
if __name__ == "__main__":
load_dotenv()
app = create_app()
app.run()
| StarcoderdataPython |
1762891 | from django.db import models
from django.urls import reverse
from django.conf import settings
class Team(models.Model):
date = models.DateField()
duty = models.JSONField(blank=True, null=True)
def __str__(self):
return self.date
class Event(models.Model):
user = models.ForeignKey(settings.AU... | StarcoderdataPython |
55286 | <filename>e3/execution/grinder/confluence/persona/Commentor.py
import random
from confluence.common.helper.ConfluenceUserCreator import create_user
from confluence.common.helper.Authentication import login, logout
from confluence.common.helper.ResourceUtils import *
from confluence.common.wrapper.User import User
fro... | StarcoderdataPython |
1622000 | <reponame>prorevizor/noc
# ----------------------------------------------------------------------
# Database migrations
# ----------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------... | StarcoderdataPython |
1778001 | from django.core.exceptions import ValidationError
from calistra_lib.task.reminder import Reminder
from datetime import datetime as dt
from calistra_web.settings import TIME_FORMAT, TIME_FORMAT_WITH_SECONDS
from calistra_lib.task.task import RelatedTaskType
def get_date(string):
return dt.strptime(string, TIME_FO... | StarcoderdataPython |
185346 | #!/usr/bin/env python3
# --- Day 13: Care Package ---
# Part Two
import sys
from day13.packages.render.arcade_game import ArcadeWindow
def main():
try:
file = open('./day13_input.txt', 'r')
except IOError:
print("Can't open file!!")
sys.exit(0)
opCodeRaw = file.readline().strip()
... | StarcoderdataPython |
189214 | # Generated by Django 3.1.4 on 2020-12-15 07:59
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('authentication', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='user',
name='city',
),
... | StarcoderdataPython |
4342 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A module containing an algorithm for hand gesture recognition"""
import numpy as np
import cv2
from typing import Tuple
__author__ = "<NAME>"
__license__ = "GNU GPL 3.0 or later"
def recognize(img_gray):
"""Recognizes hand gesture in a single-channel depth image
... | StarcoderdataPython |
5738 | <filename>gluon/main.py
#!/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by <NAME> <<EMAIL>>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
The gluon wsgi application
---------------------------
"""
from __future__ import print_function
if False: ... | StarcoderdataPython |
1715196 | <filename>rt_gene/rt_gene/src/rt_bene/estimate_blink_tensorflow.py
from __future__ import print_function, division, absolute_import
import numpy as np
import cv2
import tensorflow as tf
from tqdm import tqdm
from rt_gene.download_tools import download_blink_tensorflow_models
from rt_bene.estimate_blink_base import Bli... | StarcoderdataPython |
1749375 | <gh_stars>1-10
"""
This module provides testing functionality of the Apache Tez Init Action.
Test logic:
1. On dataproc 1.1 or 1.2 cluster is created using Tez init action. Test script verify_tez.py is
executed on every master node. Test script run example Tez job and successful execution is expected.
2. On dataproc 1... | StarcoderdataPython |
1601849 | <filename>helpers/time.py<gh_stars>1-10
from datetime import timedelta
from discord.ext import commands
from durations_nlp import Duration
PERIODS = (
("year", "y", 60 * 60 * 24 * 365),
("month", "M", 60 * 60 * 24 * 30),
("day", "d", 60 * 60 * 24),
("hour", "h", 60 * 60),
("minute", "m", 60),
... | StarcoderdataPython |
3270698 | <filename>bin/generate-csv-people.py
#!/usr/bin/env python
import sys
import json
import csv
import os
import os.path
import types
import utils
import logging
logging.basicConfig(level=logging.INFO)
if __name__ == '__main__':
whoami = os.path.abspath(sys.argv[0])
bindir = os.path.dirname(whoami)
rootd... | StarcoderdataPython |
34594 | <filename>_resume/build.py
"""
Build resume and cv from resume.md and cv.md
"""
import subprocess
import os.path
from jinja2 import Environment, FileSystemLoader
from datetime import date
def get_commit_hash():
out = subprocess.check_output('git show --oneline -s', shell=True)
return out.decode('utf-8') .repl... | StarcoderdataPython |
3283787 | from . import Config
from .Config import *
| StarcoderdataPython |
3369002 | <filename>PS7/A11.py
# b. solve
def solve(rho,beta,r,Delta,nu,kappa,v1):
# a. solve period 2
m2_vec,v2_vec,c2_vec = solve_period_2(rho,nu,kappa,Delta)
# b. construct interpolator
v2_interp = interpolate.RegularGridInterpolator((m2_vec,), v2_vec,
... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.