text
string
size
int64
token_count
int64
from __future__ import absolute_import from setuptools import setup from txjsonrpc import meta from txjsonrpc.util import dist setup( name=meta.display_name, version=meta.version, description=meta.description, author=meta.author, author_email=meta.author_email, url=meta.url, license=meta....
802
263
# -*- coding: utf-8 -*- import os from .control import ControlFile from .prms import PrmsModel from .utils import gsflow_io, GsConstant from .prms import Helper from .modflow import Modflow from .modsim import Modsim import flopy import subprocess as sp import platform import warnings warnings.simplefilter("always", P...
28,135
7,759
import logging import pytest from moto import mock_ec2, mock_iam, mock_sts from cloudwanderer.cloud_wanderer_resource import CloudWandererResource from cloudwanderer.storage_connectors import MemoryStorageConnector from cloudwanderer.urn import URN from tests.pytest_helpers import create_ec2_instances logger = loggi...
6,818
2,206
"""Python wrapper around the _clibs PicoSAT extension.""" import os from tt.errors.arguments import ( InvalidArgumentTypeError, InvalidArgumentValueError) if os.environ.get('READTHEDOCS') != 'True': from tt._clibs import picosat as _c_picosat VERSION = _c_picosat.VERSION def sat_one(clauses, assump...
4,596
1,414
import os import re import shutil import unittest from pathlib import Path from dianna.visualization.text import highlight_text class Example1: original_text = 'Doloremque aliquam totam ut. Aspernatur repellendus autem quia deleniti. Natus accusamus ' \ 'doloribus et in quam officiis veniam et...
3,745
1,442
import os import sys import builtins import versioneer if sys.version_info[:2] < (3, 7): raise RuntimeError("Python version >= 3.7 required.") builtins.__RBC_SETUP__ = True if os.path.exists('MANIFEST'): os.remove('MANIFEST') CONDA_BUILD = int(os.environ.get('CONDA_BUILD', '0')) CONDA_ENV = os.environ.get('...
2,983
924
""" Schedule adjustments are functions that accept a `datetime` and modify it in some way. Adjustments have the signature `Callable[[datetime], datetime]`. """ from datetime import datetime, timedelta from typing import Callable import pendulum import prefect.schedules.filters def add(interval: timedelta) -> Calla...
1,126
339
from .fmodobject import * from .fmodobject import _dll from .structures import TAG, VECTOR from .globalvars import get_class class ConeSettings(object): def __init__(self, sptr): self._sptr = sptr self._in = c_float() self._out = c_float() self._outvol = c_float() ckresult(...
12,349
4,291
from collections.abc import Iterable import warnings from hdmf.utils import docval, popargs, call_docval_func, get_docval from . import register_class, CORE_NAMESPACE from .core import NWBDataInterface, NWBData class RetinotopyImage(NWBData): """Gray-scale anatomical image of cortical surface. Array structure: ...
7,667
2,357
""" Implement a class function for user to put in a zip-code and search relevant information about business entities in that zip-code area. """ from flask.ext.wtf import Form from wtforms import StringField, BooleanField from wtforms.validators import DataRequired class inputZipForm(Form): inputZip = Stri...
370
99
''' 1. Write a Python program to access a specific item in a singly linked list using index value. 2. Write a Python program to set a new value of an item in a singly linked list using index value. 3. Write a Python program to delete the first item from a singly linked list. '''
283
74
__version__ = "0.3.4dev"
25
14
import unittest from premailer.premailer import capitalize_float_margin class UtilsTestCase(unittest.TestCase): def testcapitalize_float_margin(self): self.assertEqual( capitalize_float_margin('margin:1em'), 'Margin:1em') self.assertEqual( capitalize_float_marg...
624
188
import sys try: try: from _pydevd_bundle_ext import pydevd_cython as mod except ImportError: from _pydevd_bundle import pydevd_cython as mod except ImportError: import struct try: is_python_64bit = (struct.calcsize('P') == 8) except: # In Jython this ...
1,652
628
from tests.fixtures import api, PROJECT_NAME assert api THUMB_DATA1 = b"thisisaveryrandomthumbnailcontent" THUMB_DATA2 = b"thisihbhihjhuuyiooanothbnlcontent" def test_folder_thumbnail(api): response = api.post( f"projects/{PROJECT_NAME}/folders", name="testicek", folderType="Asset", ...
2,843
934
# Generalizando para não repetir o código! class Pessoa: def __init__(self, nome, idade): self.nome = nome self.idade = idade self.nomeclasse = self.__class__.__name__ def falar(self): print(f'{self.nomeclasse} está falando.') class Cliente(Pessoa): def comprar(self): ...
914
322
""" Copyright (c) 2022 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writin...
2,391
811
import ops import iopc TARBALL_FILE="samba-4.8.4.tar.gz" TARBALL_DIR="samba-4.8.4" INSTALL_DIR="samba-bin" pkg_path = "" output_dir = "" tarball_pkg = "" tarball_dir = "" install_dir = "" install_tmp_dir = "" cc_host = "" tmp_include_dir = "" dst_include_dir = "" dst_lib_dir = "" dst_usr_local_lib_dir = "" def set_gl...
13,483
5,941
# -*- coding: utf-8 -*- # # michael a.g. aïvázis # orthologue # (c) 1998-2019 all rights reserved # # declaration class Chain: """ A locator that ties together two others in order to express that something in {next} caused {this} to be recorded """ # meta methods def __init__(self, this, nex...
671
232
import os x = 7 print(x + 1)
30
18
#! /usr/bin/env python3 # -*- coding: utf-8 -*- import math def f(x): return math.exp(x)/x**3 def int(a,b): h = (b-a)/104 x_par = a+h x_impar = a+2*h soma_par = 0 soma_impar = 0 for i in range(52): soma_par += f(x_par) x_par += 2*h for i in range(51): soma_impar...
448
229
from almetro.instance import growing from almetro.metro import Metro import timeit class ExecutionSettings: def __init__(self, trials=1, runs=1): if not trials or trials < 1: raise TypeError('#trials must be provided') if not runs or runs < 1: raise TypeError('#runs must be...
2,055
515
# coding: utf-8 from __future__ import unicode_literals import re import json from .common import InfoExtractor from .youtube import YoutubeIE, YoutubeBaseInfoExtractor from ..compat import ( compat_urllib_parse_unquote, compat_urllib_parse_unquote_plus, compat_HTTPError ) from ..utils import ( bug_rep...
31,434
11,115
# Interfas Grafica XI # Menu from tkinter import * root=Tk() barraMenu=Menu(root) root.config(menu=barraMenu, width=600, height=400) archivoMenu=Menu(barraMenu, tearoff=0) archivoMenu.add_command(label="Nuevo") archivoMenu.add_command(label="Guardar") archivoMenu.add_command(label="Guardar Como") archivoMenu.add_s...
1,008
400
# Copyright 2017 Canonical Ltd. # Licensed under the LGPLv3, see LICENCE file for details.
91
36
# -*- coding: UTF-8 -*- import psycopg2 #postgresql import time import datetime class PgDemo: def __init__(self, host, port, db, user, pwd): self.host = host self.port = port self.db = db self.user = user self.pwd = pwd def getConnection(s...
5,589
1,672
#! /usr/bin/env python import nmrglue as ng # read in the varian data dic,data = ng.pipe.read("../common_data/2d_pipe/test.ft2") # Set the parameters u = ng.pipe.guess_udic(dic,data) # create the converter object and initilize with varian data C = ng.convert.converter() C.from_pipe(dic,data,u) # create pipe data ...
686
273
# encoding: utf-8 from __future__ import print_function import os import json from collections import OrderedDict import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.ticker import Formatter from jaqs.trade.analyze.report import Report from jaqs.data import ...
36,931
12,586
# # Lightnet data transforms # Copyright EAVISE # from .pre import * from .post import * from .util import *
114
41
from rest_framework import status from rest_framework.exceptions import APIException class BadSource(APIException): """ Exception for when a lazily-loaded data source can't be accessed for some reason """ status_code = status.HTTP_417_EXPECTATION_FAILED default_code = 'bad_source' def __i...
420
126
#!/usr/bin/env python3 # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
8,935
3,006
import numpy as np # import sys import math import os, sys, platform import astropy.units as u from sunpy import map as smap from astropy.coordinates import SkyCoord from suncasa.io import ndfits import lmfit from astropy.time import Time import matplotlib.pyplot as plt import matplotlib.colors as colors import matplot...
27,570
10,920
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('dimensions', '0001_initial'), ] operations = [ migrations.CreateModel( name='Article', fields=[ ...
1,496
409
import io import sys import unittest import asyncio import random from contextlib import redirect_stdout from .utils import * from queuebot import QueueBot, QueueConfig, DiscordUser config = { "SECRET_TOKEN": "NOONEWILLEVERGUESSTHISSUPERSECRETSTRINGMWAHAHAHA", "TA_ROLES": ["UGTA"], "LISTEN_CHANNELS": ["jo...
7,412
2,477
""" .. module:: aws_utilities_cli.iam :platform: OS X :synopsis: Small collection of utilities that use the Amazon Web Services (AWS) SDK .. moduleauthor:: dataday """ __all__ = ['generate_identity', 'generate_policy']
236
73
# Copyright 2019 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
2,556
844
# Generated by Django 2.0.3 on 2018-05-14 21:06 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('profiles', '0017_otherfiles_location'), ] operations = [ migrations.AlterField( model_name='project', name='url', ...
394
132
# # The tuner class to initiate the empirical performance tuning process # import re, sys, os from orio.main.util.globals import * import orio.main.dyn_loader, orio.main.tspec.tspec, orio.main.tuner.ptest_codegen, orio.main.tuner.ptest_driver #-------------------------------------------------- # the name of the mo...
15,189
4,250
from transformer import * from logger import logger def find_missing(): from db import paients_source, paients_info import re for pi in paients_info.find(): if paients_source.find({'_id': re.compile(pi['住院号'], re.IGNORECASE)}).count()>0: pass else: print(pi['住院号']) ...
1,862
584
#!/usr/bin/env python import os import re import subprocess import sys # version -> classifier # '' means default classifier cuda_vers = { '11.2': ['cuda11', ''] } def check_classifier(classifier): ''' Check the mapping from cuda version to jar classifier. Used by maven build. ''' cu_ver = detec...
1,904
663
# Generated by Django 3.0.2 on 2020-03-29 19:11 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('hitchhikeapp', '0010_userdata_userid'), ] operations = [ migrations.DeleteModel( name='Dog', ), ]
294
110
import pytz from datetime import date, time, datetime, timedelta from django.core.exceptions import ValidationError from django.db import models START_HOUR = 9 END_HOUR = 18 workingHours = END_HOUR - START_HOUR class Vendor(models.Model): """ This class defines which vendors are allowed raise tickets with ...
5,087
1,633
from hypothesis import given from tests.port_tests.hints import (PortedBoundingBox, PortedPoint) from tests.utils import equivalence from . import strategies @given(strategies.points) def test_basic(point: PortedPoint) -> None: assert isinstance(point.bounding_box, PortedBound...
605
175
import pytest # import station def pytest_addoption(parser): parser.addoption("--engine", action="store", default="local", help="engine to run tests with") @pytest.fixture(scope='module') def eng(request): engine = request.config.getoption("--engine") if engine == 'local': ...
424
122
#!/usr/bin/env python3 import logging import torch.nn as nn from fairseq import checkpoint_utils from fairseq.models import BaseFairseqModel, register_model from pytorch_translate import rnn from pytorch_translate.rnn import ( LSTMSequenceEncoder, RNNDecoder, RNNEncoder, RNNModel, base_architectur...
7,960
2,460
from ._utils import construct_dia, construct_hth, construct_sampling_matrix from .bsgda import bsgda, computing_sets, recon_bsgda, solving_set_covering from .ess import ess, ess_sampling, recon_ess from .fastgsss import fastgsss, recon_fastssss from .rsbs import cheby_coeff4ideal_band_pass, estimate_lk, recon_rsbs, rsb...
697
273
import tempfile import os import sys sys.path.insert(1,"../../") import h2o from h2o.estimators import H2OGeneralizedLinearEstimator, H2OGenericEstimator from tests import pyunit_utils from tests.testdir_generic_model import compare_output, Capturing, compare_params def test(x, y, output_test, strip_part, algo_name, ...
3,382
1,146
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP # # 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...
9,160
2,590
# This code is part of Qiskit. # # (C) Copyright IBM 2018, 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
4,452
1,318
######################################################################## # import default libraries ######################################################################## import os import csv import sys import gc ######################################################################## ####################...
11,269
2,996
#!/usr/bin/env python import netfilterqueue import scapy.all as scapy ack_list = [] def set_load(packet, load): packet[scapy.Raw].load = load del packet[scapy.IP].len del packet[scapy.IP].chksum del packet[scapy.TCP].chksum return packet def process_packet(packet): """Modify downloads files...
1,706
606
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import create_engine from sqlalchemy import Column, Integer, String, Text, ForeignKey, DateTime, func, Boolean from sqlalchemy.orm import relation, sessionmaker, relationship, backref from datetime import datetime import os # Database DATABASE = ...
1,757
545
from openpyxl import Workbook wb = Workbook() ws = wb.active data = [ ["Fruit", "Quantity"], ["Kiwi", 3], ["Grape", 15], ["Apple", 3], ["Peach", 3], ["Pomegranate", 3], ["Pear", 3], ["Tangerine", 3], ["Blueberry", 3], ["Mango", 3], ["Watermelon", 3], ["Blackberry", 3], ...
579
273
from bleak import BleakClient import asyncio import functools notify_uuid = "00002a19-0000-1000-8000-00805f9b34fb".format(0x2A19) def callback(sender, data, mac_address): #data = bytearray(data) dataint = int.from_bytes(data, byteorder='little', signed=True) print(mac_address, dataint) def run(addresses...
1,150
438
class Node: left = right = None def __init__(self, data): self.data = data def inorder(root): if root is None: return inorder(root.left) print(root.data, end=' ') inorder(root.right) def insert(root, key): if root is None: return Node(key) if key < root.data: ...
655
237
from ndebug import env_helpers def test_inspect_ops(mocker): mocker.patch.dict('os.environ', {'DEBUG_COLORS': 'no', 'DEBUG_DEPTH': '10', 'DEBUG_SHOW_HIDDEN': 'enabled', 'DEBUG_SOMETHING': 'null'}) ac...
625
201
#!/usr/bin/python '''***************************************************************************************************************** Seeed Studio Relay Board Library V2 Test Application #2 By John M. Wargo (https://www.johnwargo.com) ************************************************************************...
1,709
476
import os from sqlalchemy import bindparam, create_engine, exc from sqlalchemy.dialects.postgresql.json import JSONB from sqlalchemy.engine.url import URL from sqlalchemy.sql import text from .utils import log, logerr # Setup SQL Alchemy vars. pg_opts = { 'drivername': os.getenv('PG_DRIVER'), 'username': os....
2,087
649
import abc class CommandBlock: def __init__(self, command, conditional=True, mode='CHAIN', auto=True, opposite=False, single_use=True): self.command = command self.cond = conditional self.mode = mode self.auto = auto self.opposite = opposite self.sin...
29,122
8,657
import requests keyword = "python" try: kv = {'q':keyword} r = requests.get('http://www.so.com/s', params=kv) print(r.request.url) r.raise_for_status() print(len(r.text)) except: print('爬取失败')
217
88
import torch.nn as nn class RODEncode(nn.Module): def __init__(self, in_channels=2): super(RODEncode, self).__init__() self.conv1a = nn.Conv3d( in_channels=in_channels, out_channels=64, kernel_size=(9, 5, 5), stride=(1, 1, 1), padding=(4,...
4,489
2,050
from django.contrib import admin from .models import File admin.site.register(File)
85
24
import shutil import socket import subprocess import threading import json import pickle import tempfile import time import box import threading import os import base64 import getpass import urllib import requests import zipfile import sys import pprint import platform DEBUG = True BPH_TEMPLATE_...
28,022
7,854
# LSTM with Variable Length Input Sequences to One Character Output import numpy from keras.models import Sequential from keras.layers import Dense from keras.layers import LSTM from keras.utils import np_utils from keras.preprocessing.sequence import pad_sequences from theano.tensor.shared_randomstreams import ...
2,599
938
""" Direction prediction based on learning dataset from reactome PPI direction calculated from domain interaction directions """ # Imports import sqlite3, csv, os import pandas as pd import logging import pickle # # Initiating logger # logger = logging.getLogger() # handler = logging.FileHandler('../../workflow/SLK3.l...
8,541
2,495
import json import os.path import sys from exceptions import * from create_folder_structure import create_folder_structure def main(): try: if len(sys.argv) != 3: raise InvalidArgumentCount if not os.path.exists(sys.argv[2]): raise InvalidFilePath if not os.path.exi...
1,398
357
from datetime import timedelta import pytest from model_bakery import baker @pytest.fixture() def create_expire_user(): def make_user(**kwargs): user = baker.make('members.User') user.created -= timedelta(days=4) return user return make_user
277
89
from flask import request from google.auth.transport import requests import google.oauth2.id_token from server.ApplikationsAdministration import ApplikationsAdministration #Benutzer.py, BenutzerMapper + BenutzerMethoden in ApplikationsAdministration def secured(function): """Decorator zur Google Firebase-basiert...
3,952
1,020
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django import forms class NewsletterForm(forms.Form): assunto = forms.CharField() mensagem = forms.CharField(widget=forms.Textarea)
213
69
import FWCore.ParameterSet.Config as cms from RecoEgamma.ElectronIdentification.Identification.mvaElectronID_tools import * # Documentation of the MVA # https://twiki.cern.ch/twiki/bin/viewauth/CMS/MultivariateElectronIdentificationRun2 # https://rembserj.web.cern.ch/rembserj/notes/Electron_MVA_ID_2017_documentation ...
5,448
2,716
import numpy as np import gym from utils import * from agent import * from config import * def train(env, agent, num_episode, eps_init, eps_decay, eps_min, max_t): rewards_log = [] average_log = [] eps = eps_init for i in range(1, 1 + num_episode): episodic_reward = 0 done = False ...
1,676
626
#!/usr/bin/python # Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ This tool launches several shards of a gtest-based binary in parallel on a local machine. Example usage: parallel_launcher.py pat...
4,274
1,442
a = int(input()) for i in range(a): print('* '*(a-a//2)) print(' *'*(a//2))
83
39
class NoMessageRecipients(Exception): """ Raised when Message Recipients are not specified. """ pass class InvalidAmount(Exception): """ Raised when an invalid currency amount is specified """ pass
231
63
# # dp.py -- Data pipeline and reduction routines # # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # import numpy as np from collections import OrderedDict from ginga import AstroImage, colors from ginga.RGBImage import RGBImage from ginga.util import wcs ...
7,176
2,648
from torch.utils.data import Dataset from ..utils.optimal_lenght import find_optimal_lenght class PairedDataset(Dataset): def __init__( self, df, cfg, tokenizer, more_toxic_col='more_toxic', less_toxic_col='less_toxic' ): self.df = df se...
3,294
1,003
def something() -> None: print("Andrew says: `something`.")
66
23
blacklist=set() def get_blacklist(): return blacklist def add_to_blacklist(jti): return blacklist.add(jti)
117
44
from rest_framework import viewsets from rest_framework import generics from ..models import Task from .serializers import TaskSerializer class TaskViewSet(viewsets.ModelViewSet): serializer_class = TaskSerializer queryset = Task.objects.all()
260
69
__version__ = "0.0.3" __author__ = "Jason Duncan" __support__ = "jason.matthew.duncan@gmail.com"
97
45
from typing import Union, List import pexpect from figcli.utils.utils import Utils import sys class FiggyAction: """ Actions prevent cyclic dependencies, and are designed for leveraging FiggyCli for cleanup steps when running inside of tests. """ def __init__(self, command, extra_args=""): ...
1,798
580
# ============================================================================== # Copyright 2018-2020 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://ww...
7,831
2,662
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: Lars Stenseng. @mail: lars@stenseng.net """ # from qc.__version__ import __version__ import georinex as gr import numpy as np from matplotlib.pyplot import figure, show import matplotlib.pyplot as plt obs = gr.load( 'tests/test_data/Rinex3/KLSQ00GRL_R_...
7,453
3,275
from collections import OrderedDict from datetime import datetime, timezone import unittest from os.path import join from tinydb import TinyDB, storages from goldfinchsong import utils IMAGE_NAMES = ['goldfinch1.jpg', 'goldfinch2.jpg', 'goldfinch3.jpg', 'goldfinch4.jpg', 'goldfinch5.jpg'] TEST_TEXT1 = ...
8,610
2,828
# Lint as: python3 # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
2,868
1,001
from src.base.solution import Solution from src.tests.part1.q389_test_find_diff import FindDiffTestCases class FindDiff(Solution): def verify_output(self, test_output, output): return test_output[0] == output[0] def run_test(self, input): return self.findTheDifference(input[0], input[1]) ...
875
308
#unit #mydict.py class Dict(dict): def __init__(self,**kw): super(Dict,self).__init__(**kw) def __getattr__(self,key): try: return self[key] except KeyError: raise AttributeError(r"'Dict' object han no attribute'%s'" %key) def __setattr__(self,key,value): self[key]=value
293
124
import contextlib import os import tempfile import warnings from enum import Enum import mip class IISFinderAlgorithm(Enum): DELETION_FILTER = 1 ADDITIVE_ALGORITHM = 2 class SubRelaxationInfeasible(Exception): pass class NonRelaxableModel(Exception): pass class ConflictFinder: """This class...
19,623
5,884
from output.models.nist_data.atomic.integer.schema_instance.nistschema_sv_iv_atomic_integer_pattern_1_xsd.nistschema_sv_iv_atomic_integer_pattern_1 import NistschemaSvIvAtomicIntegerPattern1 __all__ = [ "NistschemaSvIvAtomicIntegerPattern1", ]
249
91
import re import xlsxwriter def parse_menu_to_excel(filename,menu_dict,days_dict,results,goal_dict,food_database,reversed_ingredient_dict,grocery_dict): # making a temporary dict to map dates and columns in excel: temp_dates_dict = {} i=0 for key in days_dict.keys(): temp_dates_dict[day...
3,919
1,442
#!/usr/bin/env python3 from sys import stderr, exit from TALinputs import TALinput from multilanguage import Env, Lang, TALcolors from parentheses_lib import recognize # METADATA OF THIS TAL_SERVICE: problem="parentheses" service="check_one_sol_server" args_list = [ ('input_formula',str), ('n',s...
1,256
475
"""Translates validation error messages for the response""" messages = { 'accepted': 'The :field: must be accepted.', 'after': 'The :field: must be a date after :other:.', 'alpha': 'The :field: may contain only letters.', 'alpha_dash': 'The :field: may only contain letters, numbers, and dashes.', ...
2,436
780
from channels import Group # websocket.connect def ws_add(message): Group("chat").add(message.reply_channel) # websocket.receive def ws_message(message): Group("chat").send({ "text": message.content['text'], }) # websocket.disconnect def ws_disconnect(message): Group("chat").discard(message.r...
333
106
from copy import deepcopy import numpy as np import pybullet as p import gym from gym import spaces from env.robot import Manipulator from env.work import Work class Env(): def __init__(self, reward, step_max_pos = 0.002, step_max_orn = 0.02, initial_pos_noise = 0.0...
8,154
2,986
import _thread import time import threading # # def print_time(threadName,delay): # count = 0; # while count < 5: # time.sleep(delay) # count += 1; # print("%s: %s" % (threadName, time.ctime(time.time()))) # # try: # _thread.start_new(print_time,("Thread-1",2,)) # _thread.start_n...
1,820
977
from django.shortcuts import render from rest_framework import generics # Create your views here. from petsAPI.models import Pets from petsAPI.serializers import PetSerializer def index(req): return render(req, 'index.html') class PetsListApiView(generics.ListCreateAPIView): queryset = Pets.objects.all() ...
492
147
import face_recognition import sys,os import re,cv2 def sorted_alphanumeric(data): convert = lambda text: int(text) if text.isdigit() else text.lower() alphanum_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ] return sorted(data, key=alphanum_key) input_dir_path=sys.argv[1] output_dir_p...
2,153
940
import requests from bbdata.config import output_api_url from bbdata.util import handle_response class Objects: base_path = "/objects" auth = None def __init__(self, auth): self.auth = auth def get_all(self, tags=None, search=None, page=None, per_page=None, writable=False): ...
7,329
2,197
from .exception import TakoException, TaskFailed # noqa from .session import connect # noqa
94
26
import argparse def parse(): parser = argparse.ArgumentParser(add_help=True) parser.add_argument('-data_dir', \ action='store', \ nargs='?', \ const=None, \ default='./dataset', \ type=str, \...
5,533
1,293