id stringlengths 2 8 | text stringlengths 16 264k | dataset_id stringclasses 1
value |
|---|---|---|
6683007 | <filename>web/app/models.py<gh_stars>1-10
from datetime import datetime
from app import db
class Users(db.Model):
user = db.Column(db.Integer, primary_key=True)
birth_date = db.Column(db.DateTime, nullable=True)
first_name = db.Column(db.String(25), nullable=False)
last_name = db.Column(db.String(25), nullable... | StarcoderdataPython |
9698658 | """
CryptoAPIs
Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of thei... | StarcoderdataPython |
9699633 | <reponame>Mr-Umidjon/Variables_and_types
# a o'zgaruvchiga 5 ni taminlang;
# b o'zgaruvchiga 4 ni taminlang;
# c o'zgaruvchiga 8 ni taminlang;
# Quyidagi ifodani natijaga chop eting: ab / c
a = 5
b = 4
c = 8
print(a * b / c)
| StarcoderdataPython |
4828821 | <gh_stars>1000+
X = "OK"
def test():
X = 4
print(X)
test()
print X
| StarcoderdataPython |
3201394 | """
FILTERED ELEMENT COLLECTOR
"""
__author__ = '<NAME> - <EMAIL>'
__twitter__ = '@solamour'
__version__ = '1.0.0'
# Importing Reference Modules
import clr # CLR ( Common Language Runtime Module )
clr.AddReference("RevitServices") # Adding the RevitServices.dll special Dynamo module to deal
# with Revit
... | StarcoderdataPython |
112875 | # sinh() function
import numpy as np
import math
in_array = [0, math.pi / 2, np.pi / 3, np.pi]
print ("Input array : \n", in_array)
Sinh_Values = np.sinh(in_array)
print ("\nSine Hyperbolic values : \n", Sinh_Values) | StarcoderdataPython |
5026086 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Visualization routines using matplotlib
"""
import copy
import logging
import numpy as np
from astropy import units as u
from matplotlib import pyplot as plt
from matplotlib.collections import PatchCollection
from matplotlib.colors import Normalize, L... | StarcoderdataPython |
1634081 | # -*- coding: utf-8 -*-
from .coin_meta import *
from .stock_meta import *
| StarcoderdataPython |
1822871 | from unittest.mock import patch
import mongomock
from snews import decider
@mongomock.patch(servers=(('localhost', 27017),))
def test_decider(mongodb):
decide = decider.Decider(
coinc_threshold=10,
msg_expiration=120,
datetime_format="%y/%m/%d %H:%M:%S",
mongo_server="mongodb://l... | StarcoderdataPython |
11301965 | <reponame>GitExl/Turrican2Editor<gh_stars>1-10
# Copyright (c) 2016, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright no... | StarcoderdataPython |
1817876 | import hashlib
from base64 import b64encode, b64decode
from config import Config
from wallet import Wallet
from .exceptions import ValidationError, InsufficientBalanceError, DuplicateNonceError
class Transaction:
def __init__(
self, sender, recipient, amount, nonce: int, fee=None, signature=None, **kwarg... | StarcoderdataPython |
8127285 | <filename>heatmap.py
#########################3#
### Written by <NAME>
### 16 Jan 2017
### Python 3.5
###########################
#########################
### PART 1: DATA HANDLING
#########################
# https://www.kaggle.com/us-drought-monitor/united-states-droughts-by-county/data#
import pandas as pd
impo... | StarcoderdataPython |
12863793 | # Generated by Django 3.2.8 on 2021-10-12 15:54
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='AspectActlog',
fields=[
('id', models.AutoF... | StarcoderdataPython |
3231114 | <gh_stars>1-10
"""
Investigate the title of an Actor's active browser window.
"""
from screenpy import Actor
from screenpy.pacing import beat
from ..abilities import BrowseTheWeb
class BrowserTitle:
"""Ask what the title of the browser's active window is.
Abilities Required:
:class:`~screenpy_selen... | StarcoderdataPython |
11245378 | import logging, weakref
import striga.core.exception
import striga.server.application, striga.server.service
import striga.service.socketserver
###
L = logging.getLogger('Frontend')
L.setLevel(logging.NOTSET)
###
class FrontendService(striga.server.service.Service):
'''
Base class for frontend service
'''
def ... | StarcoderdataPython |
4894635 | <filename>views/__init__.py<gh_stars>0
from PIL import Image
from flask import Blueprint, render_template, request, jsonify
import numpy as np
import tensorflow as tf
from util import model, lb
graph = tf.get_default_graph()
base = Blueprint('base', __name__)
THRESHOLD = 1.5
@base.route('/')
de... | StarcoderdataPython |
3243319 | <gh_stars>0
from jpfund.__morningstar import Morningstar
from jpfund.__emaxis import EMaxis
from jpfund.__nikko import Nikko
__copyright__ = 'Copyright (C) 2018 kunigaku'
__version__ = '0.0.1'
__license__ = 'MIT'
__author__ = 'kunigaku'
__author_email__ = '<EMAIL>'
__url__ = 'https://github.com/kunigaku/jpfund'
__all... | StarcoderdataPython |
4880648 |
# exports
from .helper import DatasetHelper
from .dataset import Dataset
from .full import FullDataset
from .sub import SubDataset
from .all import AllFull
from .rs import RoughSmoothFull
from .rs import RoughSmoothSub
from .gabor import GaborRoughSmoothFull
from .gabor import GaborRoughSmoothSub
| StarcoderdataPython |
12844149 | <reponame>Helveg/BlenderNEURON<filename>blenderneuron/blender/blendernode.py<gh_stars>10-100
import bpy
from blenderneuron.blender.blenderroot import BlenderRoot
from blenderneuron.blender.blenderrootgroup import *
from blenderneuron.commnode import CommNode
class BlenderNode(CommNode):
def __init__(self... | StarcoderdataPython |
11345483 | # Meme Generator 1
# Demonstrates how to draw text on images using PIL
# (Python Imaging Library)
#
# The script loads an image from the clipboard (or uses
# a default one if the clipboard is empty) and asks for
# two captions (top and bottom) that are then drawn onto
# the image.
import Image
import ImageDraw
import... | StarcoderdataPython |
3355408 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from grow import extensions
# Monkey patch grow.url before doing anything else
from grow.common import urls
urls._Url = urls.Url
class AmpDevUrl(urls._Url):
def __init__(self, path, host=None, port=None, scheme=None):
super(AmpDevUrl, self).__init__(path, host=None... | StarcoderdataPython |
3438027 | <filename>docs/src/ming_odm_properties.py<gh_stars>10-100
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Clear the class names in case MappedClasses are declared in another example
import re
from ming.odm import Mapper
Mapper._mapper_by_classname.clear()
from ming import create_datastore
from ming.odm import ThreadLo... | StarcoderdataPython |
268899 | <reponame>notnamed/social-graph<gh_stars>0
import social_graph
social_graph.init_db()
| StarcoderdataPython |
9794008 | from django.shortcuts import render
from rest_framework import viewsets
from rest_framework import filters
from rest_framework import permissions
from .serializer import FilerSerializer, FilerFolderSerializer
from filer.models import Image, File, Folder
class FilerViewSet(viewsets.ModelViewSet):
queryset = File.o... | StarcoderdataPython |
11234693 | <filename>mobilabs/py_lib/__init__.py
"""."""
from . main import get_name
| StarcoderdataPython |
6522945 | from vehicles.vehicles import Car
from vehicles.package import Package
def main():
morgan = Car(wheels=3, max_weight=100)
ferrari = Car(wheels=4, max_weight=120)
print(ferrari.speed, morgan.speed)
print(ferrari.wheels, morgan.wheels)
print(ferrari.speed)
print(ferrari.max_weight)
p1... | StarcoderdataPython |
1374 | # Author: <NAME>
# Copyright (c) 2019, <NAME>
# All rights reserved.
# based on github.com/ClementPinard/SfMLearner-Pytorch
from __future__ import division
import torch
from torch.autograd import Variable
pixel_coords = None
def set_id_grid(depth):
global pixel_coords
b, h, w = depth.size()
i_range = Va... | StarcoderdataPython |
1902166 | import shodan
from errbot import BotPlugin, arg_botcmd
# URL for Shodan Host permalinks
_HOST_URL = 'https://www.shodan.io/host/'
class Shodan(BotPlugin):
'''Use the Shodan.io API.
'''
def get_configuration_template(self):
return dict(
apikey='Shodan API Key'
)
@arg_... | StarcoderdataPython |
11339105 | <filename>src/ZEO/scripts/zeoqueue.py
#!/usr/bin/env python2.3
"""Report on the number of currently waiting clients in the ZEO queue.
Usage: %(PROGRAM)s [options] logfile
Options:
-h / --help
Print this help text and exit.
-v / --verbose
Verbose output
-f file
--file file
Us... | StarcoderdataPython |
76940 | from manim import *
from manim_ml.neural_network.layers import TripletLayer, triplet
from manim_ml.neural_network.layers.feed_forward import FeedForwardLayer
from manim_ml.neural_network.neural_network import NeuralNetwork
config.pixel_height = 720
config.pixel_width = 1280
config.frame_height = 6.0
config.frame_width... | StarcoderdataPython |
3253277 | from __future__ import division
import json
import os
import nltk
import commonfunctions as cf
wnl = nltk.WordNetLemmatizer()
from string import punctuation
from string import digits
import urllib
directory = cf.working_directory
# The dispersion plot is currently only working for a single debate - we need to thi... | StarcoderdataPython |
1790144 | # Imports: standard library
import os
import logging
# Imports: third party
import pandas as pd
def save_mrns_and_csns_csv(
staging_dir: str,
hd5_dir: str,
adt: str,
first_mrn_index: int,
last_mrn_index: int,
overwrite_hd5: bool,
):
"""
Get unique MRNs and CSNs from ADT and save to pa... | StarcoderdataPython |
8078467 | <filename>api/rest/serializers/video_seriazer.py<gh_stars>0
'''
@author: gconstantino
'''
from rest_framework import serializers
from api import models
class VideoSerializer(serializers.HyperlinkedModelSerializer):
"""
It is the basic representation of the Video model
"""
class Meta:
model = ... | StarcoderdataPython |
11276621 | from erde import autocli, utils, read_stream, write_stream
def _nullify(geoseries, nullify_irrelevant):
import numpy as np
if not nullify_irrelevant:
return geoseries.area
return np.where(geoseries.geom_type.str.endswith('Polygon'), geoseries.area, [np.nan] * len(geoseries))
@autocli
def main(input_data: read_s... | StarcoderdataPython |
4848909 | <gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def add_language_relation(apps, schema_editor):
from molo.core.models import SiteLanguage, LanguageRelation
from wagtail.wagtailcore.models import Page
if not (SiteLanguage.objects.filter(is_main... | StarcoderdataPython |
1847851 | #!/usr/bin/env python
import csv
class SequenceFileInfo:
def __init__(self, minion_reads, illumina_r1, illumina_r2, outname):
self.minion_reads = minion_reads
self.illumina_r1 = illumina_r1
self.illumina_r2 = illumina_r2
self.outname = outname
def parse_hybrid_csv(csvfile):
... | StarcoderdataPython |
1918901 | <filename>rtGradientBoostTest.py
## Code for regression tree gradient boosting model
## Import packages needed for analysis
import csv
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from sklearn.model_selection import train_test_split
from sksurv.ensemble import GradientBoostingSurvivalAna... | StarcoderdataPython |
11263959 | <filename>__init__.py
from __future__ import annotations
import re
from typing import Optional
from consts import Binyan, Present, Pronoun, Paradigm
CONSONANTS = tuple("QbvgGdDhwzj7ykxlmnsRpfZqrcStT")
GRONIYOT = tuple("hjQR")
GRONIYOT_RESH = GRONIYOT + ("r",)
PRONOUN_FUTURE_PREFIX = {
Pronoun.ANI: "Q",
Pronou... | StarcoderdataPython |
6438411 | import nltk.data
import pandas as pd
import argparse
import os
def section_start(lines, section=' IMPRESSION'):
"""Finds line index that is the start of the section."""
for idx, line in enumerate(lines):
if line.startswith(section):
return idx
return -1
def generate_whole_report_impres... | StarcoderdataPython |
11213701 | <filename>text_extraction.py
"""Program is used to extract the text from image"""
import string
import cv2
import pytesseract
def image_to_text(image_path, path_to_tesseract):
"""converted image to text"""
img = cv2.imread(image_path)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
pytesseract.... | StarcoderdataPython |
3577456 | # ============================================================================
# Copyright (c) 2018 Diamond Light Source 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... | StarcoderdataPython |
4955667 | <reponame>cbaziotis/fast_align
#!/usr/bin/env python
import os
import subprocess
import sys
import threading
# Simplified, non-threadsafe version for force_align.py
# Use the version in realtime for development
class Aligner:
def __init__(self, fwd_params, fwd_err, rev_params, rev_err, heuristic='grow-diag-final... | StarcoderdataPython |
9776479 | import os.path
import jinja2
from . import TEMPLATES_DIR
from .utils import drop_extension, get_number_of_digits_to_name
def textfiles_to_xhtml_files(input_dir, output_dir, fragment_type, include_heading=False):
"""
Converts plain text files in `input_dir` to a list of XHTML files
and saves them to `out... | StarcoderdataPython |
11213029 | <filename>_solutions/basics/types/type_float_f.py
emu = round(4.3*psi/hPa, 1)
orlan = round(40*kPa/hPa, 1)
| StarcoderdataPython |
6455272 | import autocomplete_light
from django import forms
from models import Taggable
class TaggableForm(forms.ModelForm):
class Meta:
model = Taggable
widgets = {
'tags': autocomplete_light.TextWidget('TagAutocomplete'),
}
| StarcoderdataPython |
3334701 | <filename>models_all_solvable2/syn40m03hfsg.py
# MINLP written by GAMS Convert at 05/07/21 17:13:06
#
# Equation counts
# Total E G L N X C B
# 1998 756 162 1080 0 0 0 0
#
# Variable counts
# x b ... | StarcoderdataPython |
6628102 | # scan_set.py
# Scan Gatherer to find out which cards are in a set, and create a list of
# multiverse ids for those cards.
# Lists of ids are stored in ids/FOO.txt, where FOO is the short code for an
# expansion set (see sets.py).
import os
import re
import sys
import urllib
#
import sets
import tools
SEARCH_URL = "h... | StarcoderdataPython |
4855431 | <gh_stars>10-100
from datasets import load_dataset
import os
import fire
if not os.path.exists('data'):
os.makedirs('data')
NUM_EPOCHS = 1
CKPT_DIR = 'ckpts'
if not os.path.exists(CKPT_DIR):
os.makedirs(CKPT_DIR)
def main(train_file=None, val_file=None, dataset_name=None, dataset_config_name=None, key='text... | StarcoderdataPython |
4825929 | <filename>cysecuretools/execute/provision_device_mxs40v1.py<gh_stars>1-10
"""
Copyright (c) 2018-2020 Cypress Semiconductor 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://ww... | StarcoderdataPython |
159111 | <filename>src/covid19model/ABC/distances.py
# -*- coding: utf-8 -*-
"""
Library of distance functions.
"""
import numpy as np
from numba import jit
# %% FUNCTION DEFINITIONS
###############################################################################
def Euclidean(s_param_dist,s_obs):
"""
Euclidean distanc... | StarcoderdataPython |
1846692 | <filename>tests/settings.py
# -*- coding: utf-8 -*-
# Standard library imports
import os
# Third party imports
from django import VERSION as DJANGO_VERSION
from django.conf import global_settings as default_settings
# Local application / specific library imports
TEST_ROOT = os.path.abspath(os.path.dirname(__file__... | StarcoderdataPython |
11249782 | <filename>dataviva/utils/title_case.py<gh_stars>0
import re
''' Titlecase Function '''
def title_case(string):
exceptions = ['A', 'An', 'And', 'As', 'At', 'But', 'By', 'For', 'From', 'If', \
'In', 'Into', 'Near', 'Nor', 'Of', 'On', 'Onto', 'Or', 'That', \
'The', 'To', 'With', 'Via', 'Vs... | StarcoderdataPython |
8050023 | <filename>library_api/models.py
from datetime import date
from decimal import Decimal, getcontext
from django.db import models
from django.db.models import Lookup, Field
from rest_framework.exceptions import ValidationError
from library_api.util import Penalty, InterestPerDay
@Field.register_lookup
class NotEqualLo... | StarcoderdataPython |
4936117 | #!/usr/bin/env python
import sys
import re
from neopixel import *
# LED strip configuration:
LED_COUNT = 300 # Number of LED pixels.
LED_PIN = 18 # GPIO pin connected to the pixels (must support PWM!).
LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 800khz)
LED_DMA = 5 ... | StarcoderdataPython |
8041730 | import torch
import torch.nn as nn
import math
import torch.nn.functional as F
class Triangle_transform(nn.Module):
def __init__(self, output_dim):
"""
output dim is the number of t parameters in the triangle point transformation
"""
super().__init__()
self.output_dim = ou... | StarcoderdataPython |
6685186 | import datetime
import hashlib
from django.db import models
from requests import get
from django.db import models # new
from django.shortcuts import reverse # new
from django.contrib.auth.models import AbstractUser
from django_mysql.models import ListCharField
from django.conf import settings
# Create your models her... | StarcoderdataPython |
397211 | <filename>data_munging.py
import numpy as np
import scipy.misc
import matplotlib.pyplot as plt
# import matplotlib as mpl
import os
import colorsys
import cv2
import logging
import itertools
from colorcorrect.algorithm import grey_world
from annotation import get_annotation, get_bbs
from tools_plot import dispims
fro... | StarcoderdataPython |
8106369 | <filename>src/test/demo.py
import pytest
import pathlib
import pickle
from pathlib import Path
import numpy as np
def test_demo_results():
fn = Path(__file__).resolve().parent / 'demo_result.pickle'
good_result = pickle.load(open(str(fn), 'rb'))
from pymor_dealii.pymor.demo import run
result, _, _, _ ... | StarcoderdataPython |
6637853 | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('admin/', admin.site.urls),
path('api/user/', include('user.urls')),
path('api/profile/', include('eprofile.urls')),
path('api/vote/', ... | StarcoderdataPython |
9671546 | <gh_stars>1-10
from ircu import consts
from ircu import p10
class MessageHandler(p10.MessageHandler):
token = 'EB'
command = 'END_OF_BURST'
def __init__(self, *args, **kwargs):
super(MessageHandler, self).__init__(*args, **kwargs)
def server(self, client, source, args):
# MH EB
... | StarcoderdataPython |
8050542 | <reponame>hockeyprincess/google-api-dfp-python
#!/usr/bin/python
#
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache... | StarcoderdataPython |
1762027 | from math import sqrt
n = int(input())
x,y= map(float,input().split())
for i in range(n-1):
a,b =input().split()
b= float(b)
if len(a) == 1:
if a == "N":
y+=b
if a == "S":
y-=b
if a == "W":
x-=b
if a == "E":
x+=b
else:
... | StarcoderdataPython |
5169767 | <filename>game/schema.py
import graphene
from graphene_django import DjangoObjectType
from graphql import GraphQLError
from .models import Channel, Game, Leaderboard, LeaderboardRow, ValidatePost
from users.models import Profile
from posts.models import Post
from tags.models import Tag
from chat.models import ChatRoom... | StarcoderdataPython |
8116530 | """PUMA Noise simulator
Follows https://arxiv.org/abs/1810.09572.
Includes a general RadioTelescope class that defines a telescope in terms
of various dish, packing, and instrumental noise properties, as well as
instances of this class for the full and petite configurations of PUMA
(see https://arxiv.org/abs/1907.125... | StarcoderdataPython |
1856477 | from django.test import TestCase
from django.test import override_settings
from mock import MagicMock
import mock
import datetime
import pam
import copy
from django.conf import settings
from tests.utilities.ldap import (
LdapTestCase,
build_mock_rcldap_user
)
from accounts.forms import (
AccountRequestVer... | StarcoderdataPython |
3206939 | <reponame>haomingw/xmchat
def hello():
print("Hi xmchat!")
| StarcoderdataPython |
6579580 | """*****************************************************************************
* Copyright (C) 2019 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* responsibility to ... | StarcoderdataPython |
5116637 | <filename>hash-tables/ex1/ex1.py<gh_stars>0
# Hint: You may not need all of these. Remove the unused functions.
from hashtables import (HashTable,
hash_table_insert,
hash_table_retrieve)
def get_indices_of_item_weights(weights, length, limit):
ht = HashTable(16)
... | StarcoderdataPython |
11270196 | # coding: utf-8
"""
Created on 24.11.2011
@author: prefer
"""
from abc import ABCMeta, abstractmethod
class IReport(object):
def show(self, *args, **kwargs):
"""
Deprecated: use build
"""
self.build(*args, **kwargs)
@abstractmethod
def build(self, *args, **kwargs):
... | StarcoderdataPython |
3402215 | """
Decision variables definition.
Decision variables are variables for which optimal values (in certain criteria) are searched.
Decision variables are main part of optimization problem model.
"""
__all__ = ["DecisionVariable", "IntegerVariable", "DiscreteVariable", "FloatVariable", "ChoiceVariable"]
from typing im... | StarcoderdataPython |
8145374 | import unittest
from datainput import data_load
import pandas as pd
class HelloworldTests(unittest.TestCase):
def test_get_helloworld(self):
data = pd.read_csv(r"C:\Users\Dell\Niologic\Seattle_Real_Time_Fire_911_Calls-v.csv")
self.assertEqual(data_load(data), 'Data loaded')
if __n... | StarcoderdataPython |
9766600 | import PIL
import math
MAX = 4*10**6
# Problem 2 Even Fibonnacci numbers
fib = [1, 1]
k = 1
while (True):
n = fib[k] + fib[k-1]
if(n > MAX):
break
else:
fib.append(n)
k += 1
c = 0
for i in fib:
num = str(i)
print(num + " ", end='')
c += 1
if(c % 10 == 0):
p... | StarcoderdataPython |
3438393 | # 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, software
# distributed unde... | StarcoderdataPython |
3219228 | <gh_stars>0
import asyncio
import random
import time
from types import SimpleNamespace
from typing import Union, List, Tuple
import aiohttp
from aiohttp import ClientSession, TraceRequestStartParams, TraceRequestEndParams
Number = Union[int, float]
class FlowController(aiohttp.TraceConfig):
def __ini... | StarcoderdataPython |
171614 | <reponame>cosmicc/docker-postprocess
#!/usr/bin/env python
import os
try:
sonarr_eventtype = os.environ['sonarr_eventtype']
except KeyError:
sonarr_eventtype = ''
try:
sonarr_isupgrade = os.environ['sonarr_isupgrade']
except KeyError:
sonarr_isupgrade = ''
try:
sonarr_series_id = os.environ['sonar... | StarcoderdataPython |
4865684 | from . import utils
from . import tomo_functions
from . import labber_processing | StarcoderdataPython |
1946740 | <reponame>kikacaty/AgentFormer<filename>model/agentformer_loss.py
def compute_motion_mse(data, cfg):
diff = data['fut_motion_orig'] - data['train_dec_motion']
if cfg.get('mask', True):
mask = data['fut_mask']
diff *= mask.unsqueeze(2)
loss_unweighted = diff.pow(2).sum()
if cfg.get('no... | StarcoderdataPython |
5070849 | # coding: utf-8
from django.apps import AppConfig
class RecruitmanageConfig(AppConfig):
name = 'RecruitManage'
verbose_name = u'招聘管理'
| StarcoderdataPython |
223375 | <reponame>facelessuser/coloraide<filename>tests/test_ictcp.py
"""Test ICtCp library."""
import unittest
from . import util
from coloraide import Color
class TestICtCpInputOutput(util.ColorAsserts, unittest.TestCase):
"""Test ICtCp."""
def test_input_raw(self):
"""Test raw input."""
self.asse... | StarcoderdataPython |
6568207 | <reponame>tchakravarty/PythonExamples
#====================================================================
# Purpose: Examples and exercises in Chapter 2 of 'A First Course in Statistical
# Programming with R', Braun & Murdoch (2007)
# Author: <NAME>
# Created: 23rd May 2015
# Revised:
# Comments:
#=================... | StarcoderdataPython |
1853038 | <gh_stars>1-10
from django.urls import path
from rest_framework.routers import SimpleRouter
from rgd_3d import models, views
from rgd_3d.rest import viewsets
router = SimpleRouter(trailing_slash=False)
router.register(r'api/rgd_3d/mesh', viewsets.Mesh3DViewSet, basename='mesh-3d')
router.register(r'api/rgd_3d/tiles3d'... | StarcoderdataPython |
211042 | <filename>smbprotocol/tree.py
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, <NAME> (@jborean93) <<EMAIL>>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
import logging
from collections import (
OrderedDict,
)
from smbprotocol import (
Commands,
Dialects,
)
from smbprotocol.exception... | StarcoderdataPython |
218214 | """zgrab2 scanner http"""
# -*- coding:utf-8 -*-
import os
import subprocess
import sys
import traceback
import uuid
from commonbaby.helpers import helper_dir, helper_file
from commonbaby.mslog import MsLogger, MsLogManager
from datacontract.iscoutdataset import IscoutTask
from .....clientdatafeedback.scoutdatafee... | StarcoderdataPython |
3210047 | <reponame>notoraptor/pysaurus<filename>pysaurus/core/jsonable.py
import types
from typing import Dict, Sequence
from pysaurus.core.functions import is_valid_attribute_name
from pysaurus.core.override import Override
__fn_types__ = (
types.FunctionType,
types.MethodType,
types.BuiltinMethodType,
types.... | StarcoderdataPython |
9734500 | import pygame
import random
#pylint: disable=no-member
class med:
def __init__(self):
self.img = pygame.image.load('resorces/medium.png')
self.display_width = 600
self.display_height = 700
self.img_width = 70
self.img_height = 80
self.health = 60
self.x_pos... | StarcoderdataPython |
6406593 | <gh_stars>100-1000
"""
===================
Interpolate Data
===================
In this example we show how to interpolate data from a sparse collection of points
to all the points in the cortical surface.
The method used here is biharmonic interpolation, which finds the solution with
the minimum squared Laplacian (f... | StarcoderdataPython |
3449736 | """Top-level package for COCO-Assistant."""
__author__ = """<NAME>"""
__email__ = "<EMAIL>"
__version__ = "0.4.0"
from .coco_assistant import COCO_Assistant
| StarcoderdataPython |
6635048 | from classifier import get_tweets_predictions
from bs4 import BeautifulSoup
from urllib2 import urlopen
import re
import os
import nltk
from nltk.stem.porter import PorterStemmer
from sklearn.externals import joblib
import numpy as np
import pandas as pd
from textstat.textstat import *
from vaderSentiment.vaderSentimen... | StarcoderdataPython |
4859140 | from django.urls import path
from . import views
app_name = 'projects'
urlpatterns = [
path('', views.MyProjects.as_view(), name='index'),
path('page/<int:page>', views.MyProjects.as_view(), name='index_paginated'),
path('new/', views.NewProject.as_view(), name='new'),
path('edit/<int:id>', views.Updat... | StarcoderdataPython |
11230975 | <gh_stars>0
import numpy as np
import cv2
import torch
from .post_parser import remove_subjects
def padding_image_overlap(image, overlap_ratio=0.46):
h, w = image.shape[:2]
pad_length = int(h* overlap_ratio)
pad_w = w+2*pad_length
pad_image = np.zeros((h, pad_w, 3), dtype=np.uint8)
top, left = 0, p... | StarcoderdataPython |
161941 | <gh_stars>0
import json
html = open("../../_includes/help.md", "w")
html.write(open("../resource/help.txt","r").read()) | StarcoderdataPython |
1983781 | <reponame>R1tschY/mydocpy
# -*- coding=utf-8 -*-
#
# Copyright 2017 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | StarcoderdataPython |
8097134 | <reponame>Ezibenroc/crous_menu
from setuptools import setup
if __name__ == '__main__':
setup(
name='crous_menu',
py_modules=['crous_menu'],
entry_points='''
[console_scripts]
crous_menu=crous_menu:main
''',
description='Script to fetch the CROUS menu ... | StarcoderdataPython |
11350199 | <filename>server_mysql.py
from flask import Flask, render_template, request, redirect, session, flash, get_flashed_messages
from flask_bcrypt import Bcrypt
from mysqlconnection import connectToMySQL
from datetime import datetime
import re
import os
import my_utils
app = Flask(__name__)
bcrypt = Bcrypt(app)
app.secret_... | StarcoderdataPython |
229695 | #!/usr/bin/python
from urllib.request import urlopen
from xml.etree import ElementTree as ET
url = 'http://freegeoip.net/xml/'
try:
with urlopen(url) as res:
s = res.read()
root = ET.fromstring(s)
ip = root.find('IP').text
country = root.find('CountryName').text
print('%s (%s)' % (ip, coun... | StarcoderdataPython |
1822194 | # -*- coding: utf-8 -*-
'''
The high-level capsul.api module pre-imports the main objects from several sub-modules:
Classes
-------
* :class:`~capsul.process.process.Process`
* :class:`~capsul.process.process.NipypeProcess`
* :class:`~capsul.process.process.ProcessResult`
* :class:`~capsul.process.process.FileCopyPro... | StarcoderdataPython |
1858827 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-07-03 10:59
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("organisations", "0049_auto_20180703_1030")]
operations = [
migrations.RemoveField(
... | StarcoderdataPython |
6568046 | #!/usr/bin/env python
from os import path
from setuptools import find_packages, setup
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.rst")) as fd:
long_description = fd.read()
requirements = [
"click>=6.0",
"pytest>=5.0",
]
setup(
name="pytest_click... | StarcoderdataPython |
9760616 | <filename>Example_Scripts/Ex3_User_Specific_Passes.py
# -*- coding: ISO-8859-1 -*-
##########################################
# Using the PassTools API
# Example3: Creating user-specific passes from a user DB
#
# In this example, we'll use a PassTools template to generate a set of passes, each of which is
# uniquely-cr... | StarcoderdataPython |
8190299 | <filename>legacy/utils/dashboard/pushtoDB.py
##############################################################################
# Copyright (c) 2017 ZTE Corporation and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# whic... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.