id stringlengths 1 265 | text stringlengths 6 5.19M | dataset_id stringclasses 7
values |
|---|---|---|
109671 | <reponame>Soare-Robert-Daniel/Project-Sarus
import settings
class Environment:
def __init__(self, observers=None):
self.observers = []
self.reports = []
self.population = None
def create_new_generation(self):
if self.observers:
self.show_scores()
self.c... | StarcoderdataPython |
3282178 | import argparse
import json
import numpy as np
import os
from examples.roberta.tool.eval_coqa import CoQAEvaluator
def add_arguments(parser):
parser.add_argument("--input_file", help="path to input file", required=True)
parser.add_argument("--output_file", help="path to output file", required=True)
parse... | StarcoderdataPython |
4837884 | <reponame>jiawei-mo/dsvo
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
import argparse
import rospy
import rosbag
import sensor_msgs.msg
import yaml
import numpy as np
from numpy.linalg import inv
import cv2
import tf
# parse camera calibration yaml file
def load_intrinsics( calib_data ):
width, heigh... | StarcoderdataPython |
1786679 | import json
from Cryptodome.PublicKey import RSA
from jwkest.jwe import factory
from jwkest.jwk import keyitems2keyreps
from oic.oic import AuthorizationResponse
from oic.oic import AuthorizationRequest
from oic.oic import AccessTokenResponse
from oic.oic import IdToken
from oic.oic import ProviderConfigurationRespons... | StarcoderdataPython |
151204 | <reponame>JulyKikuAkita/PythonPrac<gh_stars>1-10
__source__ = 'https://leetcode.com/problems/design-phone-directory/'
# https://github.com/kamyu104/LeetCode/blob/master/Python/design-phone-directory.py
# init: Time: O(n), Space: O(n)
# get: Time: O(1), Space: O(1)
# check: Time: O(1), Space: O(1)
# release:... | StarcoderdataPython |
1671085 | <reponame>JunNakamura/file-base-python-batch
from abc import ABC, abstractmethod
from app_name import APP_NAME
from logging import getLogger
from batch.file_lock import PIDFileLock
logger = getLogger(APP_NAME).getChild(__name__)
class BatchWithFileLock(ABC):
def __init__(self, batch_name: str):
self.__... | StarcoderdataPython |
173363 | <gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
##this will also include the MVP assessment.
# In[1]:
##load packages
import pandas as pd
import pickle
import numpy as np
from sentence_transformers import SentenceTransformer, util
import torch
# In[69]:
class STRNormali... | StarcoderdataPython |
75945 | <gh_stars>0
# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# Copyright 2020 VMware, Inc. All rights reserved.
# AUTO GENERATED FILE -- DO NOT MODIFY!
#
# vAPI stub file for package com.vmware.nsx_policy.infra.tier_0s.locale_services.
#-----------------------------... | StarcoderdataPython |
3313469 | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
from time import sleep
_START_CHAR = '['
_START_CHAR_ALT = '['
_FULL_CHAR = '█'
_FULL_CHAR_ALT = '*'
_THREE_CHAR = '▆'
_THREE_CHAR_ALT = '+'
_TWO_CHAR = '▄'
_TWO_CHAR_ALT = '-'
_ONE_CHAR = '▁'
_ONE_CHAR_ALT = '.'
_EMPTY_CHAR = ' '
_EMPTY_CHAR_ALT = ' '
_END_CHAR = ']'
... | StarcoderdataPython |
74367 | frutas = {"maça","Laranja","Abacaxi"}
frutas.add("Pera")
frutas.remove("maça")
frutas.pop()
print(frutas)
set1 = {"maça","Laranja","Abacaxi"}
set2 = {0,3,50,-74}
set3 = {True,False,False,False}
set4 = {"Roger",34,True}
print(set4) | StarcoderdataPython |
3323553 | from spyd.registry_manager import register
@register('room_player_event_handler')
class TakeFlagHandler(object):
event_type = 'take_flag'
@staticmethod
def handle(room, player, flag, version):
room.gamemode.on_player_take_flag(player, flag, version)
| StarcoderdataPython |
180915 | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import DataRequired, Regexp, EqualTo, ValidationError, Email
from .models import User
class LoginForm(FlaskForm):
username = StringField('Username', validators=[DataRequired()])
p... | StarcoderdataPython |
3261040 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 21 16:58:35 2021
@author: pablobottero
"""
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import openpyxl
from pandas.api.types import CategoricalDtype
import scipy.stats as stats
import seaborn as sns
os.chdir('/... | StarcoderdataPython |
1747148 | <gh_stars>1-10
#!/usr/bin/env python
import pysam
import numpy as np
import pandas as pd
import glob
from multiprocessing import Pool
import re
import os
forward_false_clip = re.compile('^[0][ACTG]')
reverse_false_clip = re.compile('[ACTG][0]$')
def count_softclipped(sample_folder):
bam_file = sample_folder + ... | StarcoderdataPython |
4800954 | <reponame>migalkin/NodePiece
""" Some things needed across the board"""
import torch
import numpy as np
from typing import Optional, List, Union, Dict, Callable, Tuple
KNOWN_DATASETS = ['wd50k']
def masked_softmax(x, m=None, dim=-1):
"""
Softmax with mask
:param x:
:param m:
:param dim:
:ret... | StarcoderdataPython |
1707551 | from robots.text import Text
from robots.image import Image
from robots.video import Video
from robots.user_input import user_input
from robots.state import save_content, load_content
def start():
user_input()
Text().start_robot()
Image().start_robot()
Video().start_robot()
#Youtube().start_robot()... | StarcoderdataPython |
3202268 | <filename>src/parsing_test.py<gh_stars>0
#!/usr/bin/env python
#_*_ coding: utf-8 _*_
import json
import base64
import requests
import sys
import csv
import io
import re
import rospy
import cv2
import numpy as np
from std_msgs.msg import Byte, Bool, Int16, String
from sensor_msgs.msg import Image, CameraInfo, Compres... | StarcoderdataPython |
3282015 | <reponame>GiverPlay007/aprendendo-python<filename>Solyd Python Basico/Python Basico Aula 3 - ELIF.py
#Calculadora
#Intro#
print(' ')
print('Calculadora')
print(' ')
#Seleção#
print('Qual operação deseja fazer?\n1 - Adição\n2 - Subtração\n3 - Divisão\n4 - Multiplicação')
calculo = input('R: ')
print(' ')
#Calculos#
if ... | StarcoderdataPython |
1686523 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | StarcoderdataPython |
1780743 | """
WSGI config for payment project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
import sys
import django
from django.core.wsgi import get_wsgi_application
sys.path.in... | StarcoderdataPython |
141933 | import tensorflow as tf # 1.12
import numpy as np
#Factor into config:
N_PIXEL = 784
USE_TPU = False
PATH_DATA = '/../../../data/'
if USE_TPU:
_device_update = 'tpu'
else:
_device_update = 'cpu'
IMAGE_SIZE = 28 * 28
NUM_LABELS = 10
OUTDIR = 'trained/mnist_estimator/'
lr_inital = 0.001
BATCH_SIZE = 128
EPOCH... | StarcoderdataPython |
1645685 | from __future__ import division
import simpy
import random
import numpy as np
from contextlib import suppress
import math
from printevent import print_event
class Task:
"""
Class: Creates a task object for elevators. Elevator object do not have visibility
to request but their own tasks. ElevatorControl c... | StarcoderdataPython |
3253426 | <reponame>ProKil/OS2018spring-projects-g10
===== output.py ==================================================
uint64_t = int
def Or(a, b):
return a | b
def USub(a, b):
return a - b
def Concat32(a, b):
return (a << 32) | b
def If(cond, a, b):
if cond:
return a
return b
def Extract(h... | StarcoderdataPython |
4811271 | <filename>examples/hierarchical_get.py
# Copyright 2021 LINE Corporation
#
# LINE Corporation licenses this file to you 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:
#
# https://www.apache.org/licens... | StarcoderdataPython |
1620658 | '''
Created on Mar 27, 2020
@author: ballance
'''
from typing import Dict
from enum import IntEnum, EnumMeta, Flag, Enum
from vsc.model.expr_literal_model import ExprLiteralModel
class EnumInfo(object):
"""Collects information needed by VSC"""
_info_map : Dict[object,'EnumInfo'] = {}
def __init_... | StarcoderdataPython |
3323718 | <reponame>christabella/GPflow
# Copyright 2020 GPflow authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | StarcoderdataPython |
47494 | <reponame>DigitalCoin1/L2SPERO<filename>datapack/data/scripts/custom/6667_ClanManager/__init__.py<gh_stars>0
import sys
from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance
from com.l2jfrozen.gameserver.model.actor.instance import L2NpcInstance
from java.util import Iterator
from com.l2jfrozen.util.da... | StarcoderdataPython |
3334596 | <gh_stars>1-10
"""
# Definition for a Node.
class Node:
def __init__(self, val, prev, next, child):
self.val = val
self.prev = prev
self.next = next
self.child = child
"""
class Solution:
def flatten(self, head: 'Node') -> 'Node':
if not head: return None
dfs ... | StarcoderdataPython |
1640181 |
"""Functions for editing a folder"""
from ..ski import skiboot, read_json
from ..ski.excepts import ServerError
from . import project_loaded, item_info, ident_exists
def _get_folder(project, foldernumber):
"""On success return (deep copy of folder, empty string)
on failure return (None, failure string)... | StarcoderdataPython |
3376536 | <reponame>yangyueren/NEROtorch<gh_stars>0
import torch
import ujson as json
import numpy as np
import sys
import random
from tqdm import tqdm
from collections import Counter
from util import get_batch, get_patterns, merge_batch, weight_init
from models.pat_match import Pat_Match
from models.soft_match_bert import Soft... | StarcoderdataPython |
4833682 | <filename>P5015.py
from sys import stdin
pattern = stdin.readline().rstrip()
plen = len(pattern)
file_cnt = int(stdin.readline().rstrip())
for _ in range(file_cnt):
file = stdin.readline().rstrip()
flen = len(file)
cache = [[False] * (flen + 1) for _ in range(plen + 1)]
cache[plen][flen] = True
for ... | StarcoderdataPython |
1729157 | """
A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,
a^2 + b^2 = c^2
For example, 3^2 + 4^2 = 9 + 16 = 25 = 52.
There exists exactly one Pythagorean triplet for which a + b + c = 1000.
Find the product abc.
"""
from itertools import permutations
if __name__ == '__main__':
break_it... | StarcoderdataPython |
1793592 | import yara
from microengine import Microengine
import tempfile
import os
RULES_DIR = 'data/yara-rules/'
class YaraMicroengine(Microengine):
"""Microengine which matches samples against yara rules"""
def __init__(self, polyswarmd_addr, keyfile, password, api_key=None):
"""Initialize a Yara microengi... | StarcoderdataPython |
3210398 | class Collect:
"""Collect data from the loader relevant to the specific task.
This keeps the items in ``keys`` as it is, and collect items in
``meta_keys`` into a meta item called ``meta_name``.This is usually
the last stage of the data loader pipeline.
For example, when keys='imgs', meta_keys=('fi... | StarcoderdataPython |
63837 | <reponame>robertjoosten/exdir
from exdir.directory import File
__author__ = "<NAME>"
__author_email__ = "<EMAIL>"
__version__ = "1.0.0"
| StarcoderdataPython |
84646 | <reponame>artemmoskalev/relart
from .seasonal_features import *
| StarcoderdataPython |
83667 | # 6. Лица на фигури
# Да се напише програма, в която потребителят въвежда вида и размерите на геометрична фигура и пресмята лицето й.
# Фигурите са четири вида: квадрат (square), правоъгълник (rectangle), кръг (circle) и триъгълник (triangle).
# На първия ред на входа се чете вида на фигурата (square, rectangle, circle... | StarcoderdataPython |
3203516 | #!/usr/bin/python
# Classification (U)
"""Program: rabbitmqpub_setupexchange.py
Description: Unit test of rabbitmqpub.setup_exchange in rabbitmq_class.py.
Usage:
test/unit/rabbitmq_class/rabbitmqpub_setupexchange.py
Arguments:
"""
# Libraries and Global Variables
# Standard
import sys
impor... | StarcoderdataPython |
3348199 | # Count the number of zeros at the end of a factorial.
def factorial_zeros(n):
five_factors = 0
while n > 4:
n /= 5
five_factors += n
return five_factors
import unittest
class Test(unittest.TestCase):
def test_factorial_zeros(self):
self.assertEqual(factorial_zeros(4), 0)
self.assertEqual(fac... | StarcoderdataPython |
3356540 | <filename>venv/Lib/site-packages/torch/distributions/weibull.py<gh_stars>1-10
import torch
from torch.distributions import constraints
from torch.distributions.exponential import Exponential
from torch.distributions.transformed_distribution import TransformedDistribution
from torch.distributions.transforms import A... | StarcoderdataPython |
1736984 | <filename>tests/web_tool_plugins/jshint_tool_plugin/test_jshint_tool_plugin.py
"""Unit tests for the jshint plugin."""
import argparse
import os
import subprocess
import mock
from yapsy.PluginManager import PluginManager
import statick_tool
from statick_tool.config import Config
from statick_tool.package import Packa... | StarcoderdataPython |
1640251 | <reponame>yangjourney/sosotest
from email import charset
charset.add_charset('utf-8', charset.SHORTEST, charset.BASE64, 'utf-8')
import datetime,os
import smtplib
from email.mime.multipart import MIMEMultipart #import email.MIMEMultipart
from email.mime.text import MIMEText #import email.MIMEText
from emai... | StarcoderdataPython |
1685112 | """
util.py
Author: <NAME> < hc at vst.io >
Date: 2012-10-14
"""
def calc_table_col_widths(rows, table_width):
max_chars_per_col = [0] * len(rows[0])
for row in rows:
for idx, col in enumerate(row):
for line in str(col).split('\n'):
max_chars_per_col[idx]... | StarcoderdataPython |
1663178 | import click
from .lib import (
auth_client,
common_options,
prettyprint_json,
search_client,
token_storage_adapter,
)
@click.command(
"create-index",
help="Create the Index for Searchable Files.\n"
"The index will be owned by the current user and will have an "
"automatically cho... | StarcoderdataPython |
1770795 | import numpy as np
import pickle
from project.utils import add_beat, padding
def generator(batch_size, subdivision, timesteps, step, dataset,
phase='train', percentage_train=0.8,
constraint=False
):
if("jazz" in dataset):
Y, X_metadatas = pickle.load(open(dataset... | StarcoderdataPython |
3315034 | <reponame>kiziebar/pysitcom<filename>test/test.py<gh_stars>1-10
import unittest
import numpy as np
from pysitcom import Comet, Sitcom
class TestComet(unittest.TestCase):
def test_criteriaFail(self):
with self.assertRaises(TypeError):
Comet(["Bad", 0.5, 1])
def test_criteriaT... | StarcoderdataPython |
93580 | <gh_stars>1-10
"""Pm Controller Module"""
import os
import sys
import re
import pprint
from cement.core import interface, handler, controller, backend
from scilifelab.pm.lib.help import PmHelpFormatter
from scilifelab.utils.misc import filtered_output, query_yes_no, filtered_walk
class AbstractBaseController(control... | StarcoderdataPython |
130132 | # coding=utf-8
import unittest
import ee
from .. import tools
ee.Initialize()
class TestImages(unittest.TestCase):
def setUp(self):
self.l8SR = ee.Image("LANDSAT/LC8_SR/LC82310772014043")
self.p_l8SR_cloud = ee.Geometry.Point([-65.8109, -25.0185])
self.p_l8SR_no_cloud = ee.Geometry.Point(... | StarcoderdataPython |
3232936 | <gh_stars>1-10
from . import config as cfg # noqa: F401
__version__ = '0.0.6'
| StarcoderdataPython |
3300197 | #!/usr/bin/env python
from argparse import ArgumentParser
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import numpy as np
from skimage.io import imsave
import os
import shutil
img_height = 28
img_width = 28
img_size = img_height * img_width
h1_size = 150
h2_size = 300
z_size = ... | StarcoderdataPython |
1709978 | import apache_beam as beam
from apache_beam import ParDo, PCollection
from asgarde.transforms.do_fns_error_handling import FlatMap, FAILURES, Map, Filter
from asgarde.failure import Failure
class CollectionComposer:
"""
This class take an input PCollection and propose methods to applies function like map, fl... | StarcoderdataPython |
171226 | import getpass
import logging
import os
import pathlib
import pytest
from libtmux import exc
from libtmux.server import Server
from libtmux.test import TEST_SESSION_PREFIX, get_test_session_name, namer
logger = logging.getLogger(__name__)
@pytest.fixture(autouse=True, scope="session")
def home_path(tmp_path_factor... | StarcoderdataPython |
1707697 | import satlas.profiles
import numpy as np
def test_gaussian():
mu = 0
fwhm = 1
sigma = fwhm / (2*np.sqrt(2*np.log(2)))
amp = 1
prof = satlas.profiles.Gaussian(mu=mu, fwhm=fwhm, amp=amp, ampIsArea=False)
return np.isclose(prof(mu), amp)
def test_lorentzian():
mu = 0
fwhm = 1
gamma =... | StarcoderdataPython |
1601177 | <filename>05/Warp.py
import sys
import cv2 # it is necessary to use cv2 library
import numpy as np
import math
def main( input_filename, output_filename ):
src = cv2.imread( input_filename ) # load image from input_filename
src = src.astype('float32')/255.0 # single [0,1]
############ Edit here #####... | StarcoderdataPython |
1615657 | """Tests for helpers."""
import pytest
from kubernetes import client
from lambda_function import exceptions
from lambda_function import helpers
from . import fixtures
@pytest.mark.parametrize("group_version", fixtures.GROUP_VERSIONS)
@pytest.mark.helper
def test_calculate_client(group_version):
"""
GIVEN c... | StarcoderdataPython |
26189 | <filename>webapp/assessdb/scripts/import_csv_instruments.py
import os
import sys
import transaction
import csv
from pyramid.paster import (
get_appsettings,
setup_logging,
)
from pyramid.scripts.common import parse_vars
from ..models.meta import Base
from ..models import (
get_engine,
get_session... | StarcoderdataPython |
1790663 | """
A minimal character-level LSTM model. Written by ZhengHe (@ZhengHe-MD)
This is derived from the following scripts:
- https://gist.github.com/karpathy/d4dee566867f8291f086
- https://github.com/eliben/deep-learning-samples/blob/master/min-char-rnn/min-char-rnn.py
- https://github.com/nicodjimenez/lstm
And you might f... | StarcoderdataPython |
1652411 | <filename>main.py
from typing import Tuple
import numpy as np
import sys
legalMoves = {(1, 0), (0, 1), (1, 1), (2, 0), (0, 2), (3, 0), (0, 3), (1, 2), (2, 1)}
board = {(i, j): '' for i in range(0, 11) for j in range(0, 11)}
board[(0, 0)] = "lost"
for couple in legalMoves:
board[couple] = 'win'
for... | StarcoderdataPython |
1623764 | <filename>SuperDiffer/__init__.py
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config.from_object('config')
db = SQLAlchemy(app)
import SuperDiffer.routes
| StarcoderdataPython |
121463 | from django.conf.urls import patterns, url
import views
urlpatterns = patterns(
'',
)
| StarcoderdataPython |
3211071 | <reponame>AlexGuo1998/png-parser<gh_stars>10-100
from typing import Any, Optional
from ..chunktypes import (CHUNK_LENGTH_SIZE, TYPE_IDAT, TYPE_IEND, TYPE_IHDR,
TYPE_PLTE, TYPE_iTXt, TYPE_pHYs, TYPE_tEXt,
TYPE_tIME, TYPE_zTXt)
from ..color import Color
from .bkgd impo... | StarcoderdataPython |
1663405 | from rest_framework.generics import ListAPIView
from rest_framework.viewsets import ModelViewSet
from meiduo_admin.serializers.admin_serializers import *
from meiduo_admin.custom_pagination import MyPage
# 组表视图
class AdminGroupView(ListAPIView):
queryset = Group.objects.all()
serializer_class = AdminGroupModel... | StarcoderdataPython |
3250236 | import time
import redis
import uuid
import requests
from rest_framework.response import Response
from rest_framework.decorators import api_view
from rest_framework import status
from django.conf import settings
from django.contrib import messages
from django.shortcuts import render, redirect
from .forms import Informa... | StarcoderdataPython |
165578 | class HtmlWriter():
def __init__(self, filename):
self.filename = filename
self.html_file = open(self.filename, 'w')
self.html_file.write(
"""<!DOCTYPE html>\n""" + \
"""<html>\n<body>\n<table border="1" style="width:100%"> \n""")
def add_element(self, co... | StarcoderdataPython |
196660 | <filename>books/views.py
from django_filters import rest_framework as filters
from rest_framework import viewsets
from .filters import BookFilter
from .models import Author, Book, Publisher, Tag
from .serializers import (
AuthorSerializer,
BookSerializer,
PublisherSerializer,
TagSerializer,
)
class A... | StarcoderdataPython |
2686 | from dcstats.hedges import Hedges_d
from dcstats.statistics_EJ import simple_stats as mean_SD
import random
import math
def generate_sample (length, mean, sigma):
#generate a list of normal distributed samples
sample = []
for n in range(length):
sample.append(random.gauss(mean, sigma))
return ... | StarcoderdataPython |
147689 | previous_scores = [0] * 301
def solve(num_stairs, points):
if num_stairs < 3:
print(previous_scores[num_stairs])
return
else:
return points[num_stairs - 1] + solve(num_stairs - 1)
if __name__ == '__main__':
num_stairs = int(input())
points = [int(input()) for _ in range(num_s... | StarcoderdataPython |
3235179 | <gh_stars>0
"""Collection of code for requesting and parsing ARM data.
Documentation for the ARM Live Data Web Service can be found
here: https://adc.arm.gov/armlive/
"""
import json
import logging
import netCDF4
import pandas as pd
import requests
import time
logger = logging.getLogger(__name__)
ARM_FILES_LIST_URL ... | StarcoderdataPython |
1688589 | import glob
import json
class incident:
""" To generate the incidents dataset call generate_policy_dataset in pwpolicy_model
"""
# names = ['default', 'too_often', 'very_easy', 'eternal', 'too_hard', 'easy_recovery', 'infrequent_use', 'easy_secure', 'hard_secure', 'no_pass']
incidents = {} # will cont... | StarcoderdataPython |
25025 | # pylint: disable=arguments-differ,unused-argument,line-too-long
"""R2Plus1D, implemented in Gluon. https://arxiv.org/abs/1711.11248.
Code partially borrowed from https://github.com/pytorch/vision/blob/master/torchvision/models/video/resnet.py."""
__all__ = ['R2Plus1D', 'r2plus1d_resnet18_kinetics400',
'r2... | StarcoderdataPython |
4832581 | # coding:utf8
import requests
from bs4 import BeautifulSoup
'''
获取百度知道的页面
'''
def get_html_zhidao(url):
headers = {'User-Agent': 'Mozilla/5.0 (X11; U; Linux i686)Gecko/20071127 Firefox/2.0.0.11'}
soup_zhidao = BeautifulSoup(requests.get(url=url, headers=headers).content, "lxml")
# 去除无关的标签
[s.extrac... | StarcoderdataPython |
3359569 | import requests
from pprint import PrettyPrinter
import pickle
pp = PrettyPrinter()
with open('cagemovies.txt') as f:
lines = f.read().splitlines()
print(lines)
apiKey = '<KEY>'
#Fetch Movie Data with Full Plot
cagedict={}
data_URL = 'http://www.omdbapi.com/?apikey='+apiKey
year = ''
for movies in lines:
... | StarcoderdataPython |
3276408 | <reponame>jochenparm/moler<filename>moler/cmd/unix/sed.py
# -*- coding: utf-8 -*-
"""
Sed command module.
"""
__author__ = '<NAME>, <NAME>, <NAME>'
__copyright__ = 'Copyright (C) 2018-2019, Nokia'
__email__ = '<EMAIL>, <EMAIL>, <EMAIL>'
import re
from moler.cmd.unix.genericunix import GenericUnixCommand
from moler.e... | StarcoderdataPython |
3256272 | from django.views.generic import View
class MyNewForumView(View):
pass
| StarcoderdataPython |
1770694 | <gh_stars>1-10
myList = [1, 2, 3]
print(len(myList))
class Sample():
pass
mysample = Sample()
print(mysample)
print(myList)
class Book():
def __init__(self, title, author, pages):
self.title = title
self.author = author
self.pages = pages
def __str__(self):
return f"... | StarcoderdataPython |
3216205 | <reponame>SyyBach/slybot
#!/usr/bin/python3
import discord
from discord.ext import commands
import asyncio
#from concurrent.futures import CancelledError
#from json import load as jsonloadfile
#from gc import collect as gc_collect
#from os import makedirs
#from os.path import exists as path_exists, dirname
from rand... | StarcoderdataPython |
4812624 | <reponame>UltimatePancake/Pancakes-V3-Plugins
from .dota import Dota
def setup(bot):
bot.add_cog(Dota()) | StarcoderdataPython |
1756378 | # Generated by Django 2.2.5 on 2020-01-28 21:54
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='RepositoryFile',
fields=[
('id', models.Aut... | StarcoderdataPython |
4816360 | # Author: <NAME> <<EMAIL>>
# Copyright (c) 2014
from django.db import models
# Local module
import uploaderConstants
class Blob(models.Model):
title = models.CharField(max_length=uploaderConstants.MAX_MISC_STR_LENGTH)
author = models.CharField(max_length=uploaderConstants.MAX_MISC_STR_LENGTH)
# Could be a loc... | StarcoderdataPython |
185547 | <gh_stars>0
import wfdb
import numpy as np
import os
# Target files created using the original WFDB Software Package version 10.5.24
class test_rdsamp():
# ---------------------------- 1. Basic Tests ---------------------------- #
# Format 16/Entire signal/Digital
# Target file created with: rdsamp -r sa... | StarcoderdataPython |
1791745 | # Generated by Django 2.2.5 on 2021-09-22 21:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='PartnerPreferences',
field... | StarcoderdataPython |
3380055 | <gh_stars>1-10
from django.core.validators import MinLengthValidator
from django.db import models
from My_music_app.music_app.validators import only_letters_numbers_and_underscores_validator
class Profile(models.Model):
USERNAME_MIN_LEN=2
USERNAME_MAX_LEN=15
username=models.CharField(
max_length... | StarcoderdataPython |
179368 | <gh_stars>0
# Copyright - Transporation, Bots, and Disability Lab - Carnegie Mellon University
# Released under MIT License
import unittest
from alloy.algo import depth_first_search, breath_first_search
class TestSpatialFunction(unittest.TestCase):
def fake_child_func(self, curr_tuple):
# The curr_tuple... | StarcoderdataPython |
3365058 | <gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
import util.helpers as H
from sklearn.model_selection import learning_curve, validation_curve
from sklearn.metrics import accuracy_score, plot_confusion_matrix
import time
import itertools
SAVE_DIR = r'C:\Users\AVyasWin10EE\Desktop\Desktop_moved\Machine_L... | StarcoderdataPython |
3351867 | <filename>Python/DataCampChallenge-main/submissions/starting_kit/estimator.py<gh_stars>0
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import mean_squared_error
import pandas as pd
import numpy as np
from collections import Counter
import seaborn as sns
import matplotlib.pyplot as plt
import g... | StarcoderdataPython |
1654761 | #!/usr/bin/env python
from typing import Dict
from jesse_live.drivers import Binance, TestNetBinance
CONFIG_LIVE = {
# these values are related to the user's environment
"env": {
"notifications": {
"enable_notifications": False,
"events": {
"errors": True,
... | StarcoderdataPython |
3391714 | <reponame>FergusYip/WeatherBar
from setuptools import setup
APP = ['app.py']
DATA_FILES = ['menubar_alert_icon.ico']
OPTIONS = {
'iconfile': 'app_icon.icns',
'argv_emulation': True,
'plist': {
'LSUIElement': True,
'NSHumanReadableCopyright': 'Copyright (c) 2020 <NAME>',
'CFBundleVer... | StarcoderdataPython |
1785752 | from pyrates.utility.grid_search import grid_search
import numpy as np
from pyrates.utility.visualization import plot_connectivity
from matplotlib.pyplot import show
# Parameters
############
# general parameters
dt = 1e-4
dts = 1e-2
T = 130.
cutoff = 10.0
# model parameters
n_etas = 10
n_js = 10
etas = np.linspace(... | StarcoderdataPython |
3390731 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright (c) 2020 by <NAME>. ~
# :license: Apache2, see LICENSE for more details. ~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Sampl... | StarcoderdataPython |
1664804 | <filename>tp/tp10/ex4+5/server.py
import socket
import os
import threading
buffersize = 2048
def worker (conn):
while True:
try:
data = conn.recv(buffersize)
except:
break
msg = data.decode("utf-8")
cmd = msg.split()
print (cmd)
r, w = os.pi... | StarcoderdataPython |
1630659 | import sqlite3,tkinter.messagebox
from tkinter import *
from tkinter import filedialog
from tkinter import ttk
from datetime import datetime
class program:
def ekle(s):
def kaydet(s):
if inputisim.get() and inputsinif.get():
tarih=datetime.now().strftime("%m/%d/%y, %H:%M... | StarcoderdataPython |
3229151 | import io
import os
import re
from setuptools import find_packages, setup
def read(path):
path = os.path.join(os.path.dirname(__file__), path)
with io.open(path, "r", encoding="utf-8") as f:
return f.read()
versionf_content = read(os.path.join("crate", "migr8", "__init__.py"))
version_rex = r'^__ve... | StarcoderdataPython |
12783 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Taskmaster-2 implementation for ParlAI.
No official train/valid/test splits are available as of 2020-05-18, so we m... | StarcoderdataPython |
17604 | <filename>merge_sort.py<gh_stars>0
import sys
import unittest
def merge(nums1, nums2):
"""
:param nums1: Sorted list of numbers.
:param nums2: Sorted list of numbers.
:return: Combined sorted list of numbers.
"""
merged = list()
while len(nums1) != 0 and len(nums2) != 0:
if nums1... | StarcoderdataPython |
4834449 | from goscale.cms_plugins import GoscaleCMSPluginBase
from cms.plugin_pool import plugin_pool
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
import models
GOSCALE_PICTURES_PLUGIN_TEMPLATES = getattr(settings, 'GOSCALE_PICTURES_PLUGIN_TEMPLATES', (
('grid.html', _('Grid')),
... | StarcoderdataPython |
3370838 | <reponame>anshu7919/NBApredict
"""
getters contains functions which may be commonly used to get certain subsets of data, data transformations, or data
summaries
"""
from datetime import timedelta
import pandas as pd
def get_games_on_day(schedule, session, date):
"""Return the games from schedule on the specified... | StarcoderdataPython |
177005 | <reponame>cmput402-w19/code-quality
from repoAnalyzer2 import RepoStats, extractRepoName
def main():
repo_name = input("Please enter git url to the downloaded repo you wish to analyze: ").strip()
repo_type = input("Plese enter the repo type (js, py, java): ")
last_hash = input("Please enter the last commi... | StarcoderdataPython |
60339 | <reponame>Naouali/holbertonschool-machine_learning<filename>math/0x01-plotting/2-change_scale.py<gh_stars>0
#!/usr/bin/env python3
"""
change scale
"""
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0, 28651, 5730)
r = np.log(0.5)
t = 5730
y = np.exp((r / t) * x)
plt.plot(x, y)
plt.yscale("log")
plt.... | StarcoderdataPython |
176128 | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sn
import pandas as pd
import os
from scipy.stats import chi2_contingency
def chi_squared_yates(
no_Gold, no_Resections, no_No_Surgery,
no_Gold_absent_term, no_Resections_absent_term, no_No_Surgery_absent_t... | StarcoderdataPython |
4842871 | from core import db
from commands.decorator import command
from ui.window import Window
from .controller import PlaylistController
from .models import Playlist
@command()
def toggle_playlists(controller: PlaylistController):
controller.toggle_playlists()
@command()
async def create_playlist(window: Window):
... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.