id
stringlengths
1
7
text
stringlengths
6
1.03M
dataset_id
stringclasses
1 value
85243
<reponame>MadeInHaus/django-social from django.contrib import admin from ..models import (FacebookAccount, FacebookMessage, FacebookSearch, TwitterAccount, TwitterMessage, TwitterSearch, RSSAccount, RSSMessage, Message, InstagramAccount, InstagramSearch...
StarcoderdataPython
1721102
from koala.sequence_id import SequenceId _request_id = SequenceId() _reentrant_id = SequenceId() def set_request_id_seed(seed: int): _request_id.set_seed(seed) def new_request_id() -> int: return _request_id.new_id() def set_reentrant_id_seed(seed: int): _reentrant_id.set_seed(seed) def new_reentra...
StarcoderdataPython
79101
import warnings from random import randint from unittest import TestCase from .models import ( ColumnFamilyTestModel, ColumnFamilyIndexedTestModel, ClusterPrimaryKeyModel, ForeignPartitionKeyModel, DictFieldModel ) from .util import ( connect_db, destroy_db, create_model ) class Colu...
StarcoderdataPython
3230009
import time #start = time.perf_counter() import tensorflow as tf import argparse import pickle import os from model import Model from utils import build_dict, build_train_dataset, batch_iter # Uncomment next 2 lines to suppress error and Tensorflow info verbosity. Or change logging levels # tf.logging.set_verbosity(tf...
StarcoderdataPython
1678825
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
StarcoderdataPython
196446
from bplot import svgbase from bplot import text class Table(svgbase.Container): def __init__(self, insert, size, matrix, rows=None, cols=None, show_value=None, show_rows=None, show_cols=None, value_pos='middle:...
StarcoderdataPython
1682123
<reponame>grg121/headmouse<filename>camera_opencv.py import sys import keyboard import cv2 import pyautogui from base_camera import BaseCamera import numpy as np # multiple cascades: https://github.com/Itseez/opencv/tree/master/data/haarcascades face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xm...
StarcoderdataPython
1717821
import vdomr as vd from .viewcontainer import ViewContainer from .forestviewcontrolpanel import ForestViewControlPanel import uuid import multiprocessing import traceback import sys import time from mountaintools import client as mt # MEDIUM TODO move tabs between north/south containers # MEDIUM TODO cross-correlogram...
StarcoderdataPython
158281
import click from click.testing import CliRunner from cthulhu.bin.cli import main def test_cthulhu(): runner = CliRunner() results = runner.invoke(main, ['--help']) assert results.exit_code == 0 assert "Create a distributed test fixture for use on a Unix-like system." in results.output
StarcoderdataPython
172539
<reponame>mrh1997/headlock<gh_stars>1-10 """ This is for headlock internal use only! """ from typing import Tuple, Callable import abc from collections.abc import ByteString class MemoryManagementError(Exception): """ This exception occurs, when if memory allocation/release failed. """ class AddressSpac...
StarcoderdataPython
1771310
<filename>cptm/utils/topics.py import pandas as pd def get_top_topic_words(topics, opinions, t, top=10): """Return dataframe containing top topics and opinions. Parameters t : str - index of topic number top : int - the number of words to store in the dataframe Returns Pandas DataFrame ...
StarcoderdataPython
4805275
from delira._debug_mode import get_current_debug_mode, switch_debug_mode, \ set_debug_mode from delira._backends import get_backends, seed_all from ._version import get_versions as _get_versions import warnings warnings.simplefilter('default', DeprecationWarning) warnings.simplefilter('ignore', ImportWarning) _...
StarcoderdataPython
1621381
from .kitti import KittiDataset from .nuscenes import NuScenesDataset from .lyft import LyftDataset dataset_factory = { "KITTI": KittiDataset, "NUSC": NuScenesDataset, "LYFT": LyftDataset, } def get_dataset(dataset_name): return dataset_factory[dataset_name]
StarcoderdataPython
1762932
<reponame>Mirmik/gxx #!/usr/bin/env python3 #coding: utf-8 from licant.modules import submodule from licant.cxx_modules import application from licant.scripter import scriptq import licant scriptq.execute("../../../gxx.g.py") application("target", sources = ["main.cpp"], mdepends = ["gxx"] ) licant.ex(default = "...
StarcoderdataPython
3220399
<gh_stars>0 # Software License Agreement (BSD License) # # Copyright (c) 2012, <NAME>, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the ...
StarcoderdataPython
1708314
<gh_stars>0 import rpyc class RobotService(rpyc.Service): def __init__(self, robot): super().__init__() self.exposed_robot = robot def on_connect(self, conn): # code that runs when a connection is created # (to init the service, if needed) pass def on_disco...
StarcoderdataPython
110836
<reponame>excelsimon/AI # -*- coding:utf-8 -*- import re from sklearn.model_selection import train_test_split from sklearn.naive_bayes import MultinomialNB from sklearn.feature_extraction.text import CountVectorizer class LanguageDetector(): def __init__(self,classifier=MultinomialNB()): self.class...
StarcoderdataPython
132780
<gh_stars>1-10 from pytest import approx def test_consult_for_daiweth(pool_daiweth_30bps, quanto_feed): seconds_agos = [7200, 3600, 600, 0] windows = [3600, 3600, 600] now_idxs = [1, len(seconds_agos)-1, len(seconds_agos)-1] tick_cums, secs_per_liq_cums = pool_daiweth_30bps.observe(seconds_agos) ...
StarcoderdataPython
183246
''' Hackerrank: https://www.hackerrank.com/challenges/coin-change/problem this solution will get timeout in many test cases however, this solution can get all the combination during computation ''' import sys from collections import Counter, defaultdict sys.setrecursionlimit(10000) memory = defaultdict(list) def rec...
StarcoderdataPython
1721712
<reponame>coolexplorer/slackbot-buffy<gh_stars>1-10 import logging from constant.k8s_command import k8s_commands, k8s_sub_commands logger = logging.getLogger(__name__) class K8SParser: def __init__(self, k8s, message): self.k8s = k8s self.message = message self.command = self.message[0]....
StarcoderdataPython
1634700
import skimage.draw as skd import skimage.io as skio import numpy as np import h5py import itertools import random from typing import List from dataclasses import dataclass, field def default_float(n=1,low=0.0,high=1.0): if n == 1: return field(default_factory = lambda: np.random.uniform(low, high) ) e...
StarcoderdataPython
59966
<gh_stars>0 ################################# # #Katma değer ciro view # ################################# try: from tkinter import * from tkinter import ttk except ImportError: #for python 2.7+ from Tkinter import * import ttk class kdc_View: def __in...
StarcoderdataPython
3325352
# multi_spect_reg_config.py # Copyright (c) 2020, <NAME>, <NAME>, University of Nevada, Reno. # All rights reserved. import SimpleITK as sitk import os import configparser import numpy as np class camera_parameter_t(): def __init__(self, camera_name, fx, fy, cx, cy, dist_vect): self.camera_name = camera_name sel...
StarcoderdataPython
94690
import pandas as pd df = pd.read_csv("data.csv") df.head() bools_distance = [] for distance in df.Distance: if distance <= 100: bools_distance.append(True) else: bools_distance.append(False) temp_distance = pd.Series(bools_distance) temp_distance.head() distance = df[temp_dist...
StarcoderdataPython
8351
<reponame>haltu/velmu-mpass-demo<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-03-20 08:34 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import parler.models class Migration(migrations.Migration): initial = True ...
StarcoderdataPython
3271122
import numpy as np import torch class UnNormalize(object): def __init__(self, mean, std): self.mean = mean self.std = std def __call__(self, imgs): """ Args: tensor (Tensor): Tensor image of size (B, C, H, W) to be normalized. Returns: Tensor: N...
StarcoderdataPython
1753414
# -*- coding:utf-8 -*- mongo_dsn = 'mongodb://root:123123@127.0.0.1/proxy?authSource=admin' mongo_db = 'proxy' # 抓取代理的站点 crawl_web_site = ['ip66', 'ip181', 'xici'] debug = 1
StarcoderdataPython
1708907
<filename>Method/ontolearn/abstracts.py import logging import random from abc import ABCMeta, abstractmethod, ABC from typing import Set, List, Tuple, Iterable, TypeVar, Generic, ClassVar, Optional, Generator, SupportsFloat import numpy as np import torch from owlapy.model import OWLClassExpression, OWLOntology from ...
StarcoderdataPython
3289204
glossary = { 'integer': 'is colloquially defined as a number that can be written without a fractional component.\n', 'iterate': 'is the repetition of a process in order to generate a sequence of outcomes.\n', 'indentation': 'is an empty space at the beginning of a line that groups particular blocks of code....
StarcoderdataPython
3368731
from django.db import models from import_common.core import matchuj_wydawce from .base import BasePBNMongoDBModel from bpp.models import LinkDoPBNMixin, const class PublisherManager(models.Manager): def official(self): return self.exclude(mniswId=None) class Publisher(LinkDoPBNMixin, BasePBNMongoDBMod...
StarcoderdataPython
159328
import re def sort_urls(url_list,reverse=True): return sorted(url_list, key=lambda k: k['bandwidth'], reverse=reverse) def name_checker(name): name = name.replace("'", "") name = re.findall(r"([\w\d-]+)", name) return ' '.join([x for x in name])
StarcoderdataPython
90950
<filename>fig/falcon/__init__.py from .api import FalconAPI from .models import Event from .stream import StreamManagementThread __all__ = ['Event', 'FalconAPI', 'StreamManagementThread']
StarcoderdataPython
1604779
# -*- coding: utf-8 -*- """ Created on Tue May 29 15:33:14 2018 @author: jonatha.costa """ import requests from bs4 import BeautifulSoup import pandas as pd import datetime import re import numpy as np from readability import Document import requests from readability.readability import Document impor...
StarcoderdataPython
73686
<reponame>suamin/nemex<gh_stars>1-10 """ Nemex module. Classes: - Nemex """ import time from .data import EntitiesDictionary from .utils import * from .similarities import Verify from .faerie import Faerie logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) logger = log...
StarcoderdataPython
4807833
#!/usr/bin/env python print "hello World, Welcome to python"
StarcoderdataPython
1771626
"""ExpNushellxLpt.py Definition for namedtuple representation of a set of *.lpt file data from running NuShellX on Magnus, Heiko, or normal-ordered interactions """ from __future__ import print_function, division, unicode_literals from collections import namedtuple # noinspection PyClassHasNoInit class ExpNushellxLp...
StarcoderdataPython
129978
<gh_stars>0 # # Copyright 2012 New Dream Network, LLC (DreamHost) # # Author: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # 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.a...
StarcoderdataPython
159819
import os import json path = "P2S2/" example = {} example["labels"] = ["Background","Vegetation","Organ","Don't know"] example["models"] = [] dirs = [item for item in os.listdir(path) if os.path.isdir(os.path.join(path,item))] print(dirs) for dir_ in dirs: if dir_ == "images": example["imageURLs"] = ["data/im...
StarcoderdataPython
1603061
""" Tyes for storage nodes. """ import os import re class Cache: """ Data structure to handle cache operations Operations: get(filename: str) -> str | None set(filename: str, content: str) -> None """ def __init__(self, cache_folder='cache'): self.path = f'./{cache_folder}...
StarcoderdataPython
151286
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import contextlib import re import sys # NOTE: this module doesn't import sublime module so we can mock view/region etc in tests LIST_ENTRY_BEGIN_RE = re.compile( r"""^( \s+[*] | \s*[-+] | \s*[0-9]+[.] | \s[a-zA-Z][.] ...
StarcoderdataPython
1799861
#!/usr/bin/python3 """ Application loader. Handles: - flaskenv loading - requirement updates for all plugins/macros and main application (if network is available) - database upgrade - loading WSGI server in production mode """ if __name__ == "__main__": from sys import path path.append('webapi...
StarcoderdataPython
1725547
import numpy as np from datashader.composite import add, saturate, over, source src = np.array([[0x00000000, 0x00ffffff, 0xffffffff], [0x7dff0000, 0x7d00ff00, 0x7d0000ff], [0xffff0000, 0xff000000, 0x3a3b3c3d]], dtype='uint32') clear = np.uint32(0) clear_white = np.uint32(0x00ffffff) w...
StarcoderdataPython
51224
import sys import asyncio import zmq import zmq.asyncio from zmq.auth import Authenticator from zmq.auth.thread import _inherit_docstrings, ThreadAuthenticator, \ AuthenticationThread # Copying code from zqm classes since no way to inject these dependencies class MultiZapAuthenticator(Authenticator): """ ...
StarcoderdataPython
3270380
<filename>quidel/tests/test_handle_wip_sensor.py import unittest from delphi_quidel.handle_wip_sensor import add_prefix from delphi_quidel.constants import SENSORS class MyTestCase(unittest.TestCase): def test_handle_wip_sensor(self): # Test wip_signal = True, Add prefix to all signals sensors = l...
StarcoderdataPython
27163
<reponame>raimota/Gerador-Validador-CPF_CNPJ<filename>app/models/forms.py from flask_wtf import FlaskForm from wtforms import StringField from wtforms.validators import DataRequired class Campos(FlaskForm): es = StringField('es')
StarcoderdataPython
1608751
<gh_stars>0 import sys, csv, getopt, codecs, datetime from collections import OrderedDict class Day(object): def __init__(self, date, distance): self.date = date self.distance = distance def csv_day(self): return [self.date, self.distance] def get_date(entry): date_str = entr...
StarcoderdataPython
3352533
from unittest import TestCase from Cuenta import Cuenta class TestCuenta(TestCase): def test_depositar(self): C = Cuenta("Mayorquin", "0", 0.0) self.assertEqual(C.depositar(5000), 5000) def test_retirar(self): C= Cuenta("mayorquin", "0", 500.00) self.assertEqual(C.ret...
StarcoderdataPython
114799
# This file implements spiking neural networks as described # in the work: # <NAME>, Coarse scale representation of spiking neural networks: # backpropagation through spikes and applications to neuromorphic hardware, # International Conference on Neuromorphic Systems (ICONS), 2020 import argparse import t...
StarcoderdataPython
1781807
from abc import ABC, abstractmethod class Debuggable(ABC): """ The Debuggable "mixin" marks a class as having the debug_str method, allowing other functions to print this information when needed. """ @abstractmethod def debug_str(self): """A debug string is used for providing better er...
StarcoderdataPython
51479
from django.core.exceptions import PermissionDenied from django.utils import timezone from .models import Item from datetime import datetime def active_auction(function): def wrap(request, *args, **kwargs): item = Item.objects.get(slug=kwargs['slug']) if item.end_of_auction > timezone.now(): ...
StarcoderdataPython
1647960
<filename>python/hash_tailored_audience_file.py #!/usr/bin/env python """ Copyright (C) 2014-2016 Twitter Inc and other contributors. 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 h...
StarcoderdataPython
3342551
# desafio 15 c = float(input('Digite a temperatura em ºC: ')) f = (c*9/5)+32 k = c+273.15 print('A temperatura é de {}ºF e {}K' .format(f, k)) # desafio 15 km = float(input('Digite quantos Km o carro percorreu: ')) dias = float(input('Digite por quantos dias alugou o carro: ')) aluguel = (dias*60)+(km*0.15) print('O...
StarcoderdataPython
3339271
from setuptools import setup setup( version="0.0.2", name="dblpbib", packages=["dblpbib"], description="Download all bibtex references for provided author", author="<NAME>", author_email="<EMAIL>", entry_points = { 'console_scripts': [ 'dblpbib = dblpbib:main', ],...
StarcoderdataPython
3237630
<filename>training/views.py from django.contrib import messages from django.http import HttpResponseRedirect from django.shortcuts import render # Create your views here. from django.urls import reverse from ems_admin.decorators import log_activity from ems_auth.decorators import hr_required from organisation_details...
StarcoderdataPython
3206085
import json import logging from io import StringIO from urllib import parse from bottle import abort from devmine.lib.composition import rank from devmine.app.controllers.application_controller import ( ApplicationController, enable_cors ) class SearchController(ApplicationController): """Class for handl...
StarcoderdataPython
181770
from edge.command.common.precommand_check import check_gcloud_authenticated, check_project_exists, check_billing_enabled from edge.config import GCProjectConfig, StorageBucketConfig, EdgeConfig from edge.enable_api import enable_service_api from edge.exception import EdgeException from edge.gcloud import is_authenticat...
StarcoderdataPython
1635170
''' Написать функцию maxfun(), которая принимает переменное число параметров — числовую последовательность S, функцию F1 и, возможно, ещё несколько функций F2 … Fn. Возвращает она ту из функций Fi, сумма значений которой на всех элементах S наибольшая. Если таких функций больше одной, возвращается Fi с наибольшим i. I...
StarcoderdataPython
3359149
# Generated by Django 3.0.3 on 2020-09-05 08:06 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('wallet', '0019_position_current_value'), ] operations = [ migrations.RenameField( model_name='position', old_name='current_v...
StarcoderdataPython
3257501
import asyncio from enum import Enum from sspq import * from argparse import ArgumentParser, ArgumentTypeError class OrderedEnum(Enum): def __ge__(self, other): if self.__class__ is other.__class__: return self.value >= other.value return NotImplemented def __gt__(self, other): ...
StarcoderdataPython
1622722
<filename>test/orm/test_lazytest1.py import sqlalchemy as sa from sqlalchemy.test import testing from sqlalchemy import Integer, String, ForeignKey from sqlalchemy.test.schema import Table from sqlalchemy.test.schema import Column from sqlalchemy.orm import mapper, relation, create_session from test.orm import _base ...
StarcoderdataPython
135611
from test_support import verbose, verify import sys import new class Eggs: def get_yolks(self): return self.yolks print 'new.module()' m = new.module('Spam') if verbose: print m m.Eggs = Eggs sys.modules['Spam'] = m import Spam def get_more_yolks(self): return self.yolks + 3 print 'new.classobj(...
StarcoderdataPython
141563
<reponame>84KaliPleXon3/micropython-esp32 # Calling an inherited classmethod class Base: @classmethod def foo(cls): print(cls.__name__) try: Base.__name__ except AttributeError: import sys print("SKIP") sys.exit() class Sub(Base): pass Sub.foo() # overriding a member and access...
StarcoderdataPython
54633
<gh_stars>1-10 from __future__ import annotations import typing from dsalgo.algebra.abstract.abstract_structure import Monoid from dsalgo.number_theory.floor_sqrt import floor_sqrt S = typing.TypeVar("S") class SqrtDecomposition(typing.Generic[S]): def __init__(self, monoid: Monoid[S], arr: list[S]) -> None: ...
StarcoderdataPython
136455
import boto3 import sure # noqa # pylint: disable=unused-import from moto import mock_guardduty @mock_guardduty def test_create_detector(): client = boto3.client("guardduty", region_name="us-east-1") response = client.create_detector( Enable=True, ClientToken="745645734574758463758", ...
StarcoderdataPython
3210914
from setuptools import setup setup(name='kfn', version='0.1', description='Kubeflow notebook component builder', url='https://github.com/bartgras/kf-notebook-component', author='<NAME>', author_email='<EMAIL>', license='MIT', packages=['kfn', 'kfn.test'], install_require...
StarcoderdataPython
33106
<filename>dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/Station.py # File auto-generated against equivalent DynamicSerialize Java class # # SOFTWARE HISTORY # # Date Ticket# Engineer Description # ------------ ---------- ----------- -----------...
StarcoderdataPython
1653817
# coding=utf-8 import re import logging import base64 import os import datetime from openerp.http import request import openerp from .. import client _logger = logging.getLogger(__name__) def get_img_data(pic_url): import requests headers = { 'Accept': 'textml,application/xhtml+xml,application/xml;q=0.9,im...
StarcoderdataPython
3222004
<gh_stars>1-10 # -*- coding: utf-8 -*- # @Time : 2020/8/4 下午5:25 # @Author : 司云中 # @File : seckill.py # @Software: Pycharm import uuid from rest_framework.generics import GenericAPIView class SecKillOperation(GenericAPIView): """秒杀活动""" # serializer_class = SecKillSerializer
StarcoderdataPython
1781411
<gh_stars>0 import sys import fileinput import re import pandas as pd import numpy as np import csv Lookup_gene={} for each_line_of_text in list(fileinput.FileInput('Homo_sapiens.GRCh37.75.gtf')): Ensembl_name = re.findall(r'ENSG+[0-9]{11}',each_line_of_text) HUGO_name = re.findall(r'gene_name\s"(.*?)"',each_l...
StarcoderdataPython
130266
<filename>django_orm/postgresql/sql/aggregates.py<gh_stars>1-10 # -*- coding: utf-8 -*- from django.db.models.sql import aggregates from django.db import models class ArrayLength(aggregates.Aggregate): sql_function = 'array_length' sql_template = '%(function)s(%(field)s, 1)' is_computed = True def __...
StarcoderdataPython
1611225
import unittest from bolt.core.command import Command, RegexCommand, ParseCommand from bolt.discord.events import MessageCreate from bolt.discord.models.message import Message class TestCommand(unittest.TestCase): def dummycallback(self): pass def test_command_matches(self): command = Command...
StarcoderdataPython
1619389
# K-means Clustering # Importing the librabies import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset = pd.read_csv("Mall_Customers.csv") X = dataset.iloc[:,[3,4]].values # Using the elbow method to find optimal number of clusters from sklearn.cluster import KMeans wc...
StarcoderdataPython
3284628
class InstanceReferenceGeometry(GeometryBase,IDisposable,ISerializable): """ InstanceReferenceGeometry(instanceDefinitionId: Guid,transform: Transform) """ def ConstructConstObject(self,*args): """ ConstructConstObject(self: CommonObject,parentObject: object,subobject_index: int) """ pass def Dispose(self):...
StarcoderdataPython
1604354
Nome = str(input('Digite o seu nome: ')).strip() print('analizando o seu nome...') print('Seu nome em maiuscula é: ', Nome.upper()) print('Seu nome em minuscula é: ', Nome.lower()) print('Seu nome possui {} letras'.format(len(Nome) - Nome.count(' '))) print('Seu primeiro nome é {} e possui {} letras'.format(Nome[:Nome....
StarcoderdataPython
4826555
import uuid from pyramid import httpexceptions from pyramid.settings import asbool from pyramid.security import NO_PERMISSION_REQUIRED, Authenticated from kinto.core import get_user_info as core_get_user_info from kinto.core.errors import raise_invalid from kinto.core.events import ACTIONS from kinto.core.storage.exc...
StarcoderdataPython
1627275
epochs = 50 class_weight={0:1.,1:1} batch_size=8
StarcoderdataPython
3277116
<filename>migrations/versions/f017a3d88213_added_set_table.py<gh_stars>0 """Added Set table Revision ID: f017a3d88213 Revises: <PASSWORD> Create Date: 2017-12-05 23:09:29.667000 """ # revision identifiers, used by Alembic. revision = 'f017a3<PASSWORD>' down_revision = '<PASSWORD>' from alembic import op...
StarcoderdataPython
1670661
<reponame>q0w/snug import json import snug BASE = 'https://api.github.com' class repo(snug.Query[dict]): """a repository lookup by owner and name""" def __init__(self, name, owner): self.name, self.owner = name, owner def __iter__(self): request = snug.GET(BASE + f'/repos/{self.owner}/{se...
StarcoderdataPython
1714613
<gh_stars>10-100 ### Copyright (C) 2017 NVIDIA Corporation. All rights reserved. ### Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). from .base_options import BaseOptions class BothOptions(BaseOptions): def initialize(self): BaseOptions.initialize(...
StarcoderdataPython
152964
""" GitLab API: https://docs.gitlab.com/ee/api/instance_level_ci_variables.html https://docs.gitlab.com/ee/api/project_level_variables.html https://docs.gitlab.com/ee/api/group_level_variables.html """ import re import pytest import responses from gitlab.v4.objects import GroupVariable, ProjectVariable, Variable k...
StarcoderdataPython
115893
<gh_stars>0 # 7652413 import euler N = 7 m = 0 d = '123456789' for i in xrange(euler.product(xrange(1, N + 1))): v = [] dd = list(d) for j in xrange(N): v.append(dd.pop(i % (N - j))) i /= (N - j) vv = int(''.join(v)) if euler.is_prime(vv) and vv > m: m = vv print m
StarcoderdataPython
1769513
from typing import Any, Tuple import numba as nb import numpy as np from nptyping import NDArray from .definitions import LatticeState, gathered_order_parameters from .tensor_tools import SQRT2, SQRT6, SQRT16, dot10, ten6_to_mat @nb.njit(nb.int32(nb.float32), cache=True) def biaxial_ordering(lam: float) -> int: ...
StarcoderdataPython
1760351
import haiku as hk import jax import jax.numpy as jnp import numpy as np from functools import partial import optax from jax.experimental.maps import mesh from jax.experimental import PartitionSpec from jax.experimental.pjit import pjit from clip_model import TextCLIP import clip_jax def cfg_encode_text(config, tok...
StarcoderdataPython
3384229
# Copyright (c) 2013 <NAME> <<EMAIL>> # This file is part of SimpleGUITk - https://github.com/dholm/simpleguitk # See the file 'COPYING' for copying permission. from .frame import create_frame from .image import get_height from .image import get_width from .image import load_image from .input import KEY_MAP from .time...
StarcoderdataPython
142865
import pytest from frameioclient import FrameioClient @pytest.fixture def frameioclient(token): return FrameioClient("aaaabbbbccccddddeeee")
StarcoderdataPython
1676894
# food1 = 'rau muong' # food2 = 'ca vien chien' # food3 = 'pho' # food4 = 'suon xao chua ngot' # food5 = 'rau' menu = ['rau muong', 'ca vien chien', 'pho','suong xao chua ngot','rau'] # seperator # print(*menu, sep=', ') #pythonic # # menu.append('bun cha') # # print(*menu, sep=', ') # print(len(menu)) # print(menu[-1...
StarcoderdataPython
3282836
<reponame>ozgurgunes/django-manifest<filename>tests/data_dicts.py # -*- coding: utf-8 -*- """ Manifest Data Dicts for Tests """ from django.utils.translation import ugettext_lazy as _ from manifest import defaults LOGIN_FORM = { "invalid": [ # No identification. { "data": {"identifica...
StarcoderdataPython
3310900
<reponame>kdmoreira/python_solutions<gh_stars>0 def sync(schedule_list): """This function returns the union of a set of schedules.""" sync_schedule = set() for schedule in schedule_list: sync_schedule = sync_schedule | schedule return sync_schedule schedules = [{'1234', '2345', '3456'}, {'4567'...
StarcoderdataPython
1618166
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Module that contains Plot Twist proxy mesh validator implementation """ from __future__ import print_function, division, absolute_import __author__ = "<NAME>" __license__ = "MIT" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" import pyblish.api import tpDcc impo...
StarcoderdataPython
1771916
import os from typing import Dict, List, Tuple import numpy as np import tensorflow as tf from model.conll_dataset import CoNLLDataset from .data_utils import get_chunks, pad_words, pad_chars from .general_utils import Progbar class NERModel: """Specialized class of Model for NER""" def __init__(self, conf...
StarcoderdataPython
3390274
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- # OpenData DWD FX Radar processing tool # Author: <NAME> # v0: First test version to read in FX binary data and create first static plot # v1: Included automatic download of latest image and further improvements # v2: Splittet program into single functions for b...
StarcoderdataPython
4837181
<filename>wavespectra/plot.py import numpy as np import xarray as xr from wavespectra.core.attributes import attrs LOG_FACTOR = 1e3 RADII_FREQ_TICKS_LOG = np.array([0.05, 0.1, 0.2, 0.3, 0.4]) RADII_FREQ_TICKS_LIN = np.arange(0.1, 1.1, 0.1) RADII_PER_TICKS_LOG = (np.array([20, 10, 5, 3, 2])) RADII_PER_TICKS_LIN = np....
StarcoderdataPython
1679902
<reponame>PMARINA/Canvas-Autograder """Handles getting assignments from Canvas API. Reference for Canvas: https://canvas.instructure.com/doc/api/assignments.html#method.assignments_api.index """ from typing import Dict from typing import List from requests import Response import Canvas_Request def process_assignme...
StarcoderdataPython
1644064
<reponame>hdoto/asterisk-mirror<filename>asterisk_mirror/main.py # -*- coding: utf-8 -*- import uuid import signal from threading import Thread, Event, Timer from typing import List from importlib import import_module from asterisk_mirror.config import AsteriskConfig from asterisk_mirror.stepper import Stepper from a...
StarcoderdataPython
1648131
<filename>lib/model/faster_rcnn/faster_rcnn.py #encoding=utf-8 import random import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import torchvision.models as models from torch.autograd import Variable import numpy as np from model.utils.config import cfg from model.rpn...
StarcoderdataPython
138470
""" sentry.cache.django ~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from django.core.cache import cache from .base import BaseCache class DjangoCache(BaseCache): def set(...
StarcoderdataPython
1787381
<filename>Scripts/simulation/global_policies/global_policy_tuning.py<gh_stars>0 # uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\global_policies\glob...
StarcoderdataPython
3250777
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = "<NAME>" import symjax.tensor as T import matplotlib.pyplot as plt from symjax.viz import compute_graph x = T.random.randn((10,), name="x") y = T.random.randn((10,), name="y") z = T.random.randn((10,), name="z") w = T.Variable(T.ones(1), name="w") out = (x ...
StarcoderdataPython
4838340
<reponame>abael/ScrapyFrontera # -*- coding: utf-8 -*- from __future__ import absolute_import from tests.backends import BackendSequenceTest, TEST_SITES from frontera.utils.tester import DownloaderSimulator, BaseDownloaderSimulator from six.moves.urllib.parse import urlparse class DFSOverusedBackendTest(BackendSequen...
StarcoderdataPython
199296
<reponame>alentoghostflame/StupidAlentoBot<filename>mmo_module/mmo.py from mmo_module.mmo_data import GuildMMOConfig, UserMMOConfig, BasicMMODataStorage, CharacterSaveData from alento_bot import BaseModule, StorageManager from mmo_module import mmo_admin, mmo_user, text from mmo_module.mmo_controller import MMOServer, ...
StarcoderdataPython