text
string
size
int64
token_count
int64
# statements that used at the start of defenition or in statements without columns defenition_statements = { "DROP": "DROP", "CREATE": "CREATE", "TABLE": "TABLE", "DATABASE": "DATABASE", "SCHEMA": "SCHEMA", "ALTER": "ALTER", "TYPE": "TYPE", "DOMAIN": "DOMAIN", "REPLACE": "REPLACE", ...
2,662
1,104
from __future__ import absolute_import, division, print_function import json import logging import os import time import importlib import multiprocessing import cv2 import fire import logzero from logzero import logger import numpy as np from rmexp import config, cvutils, dbutils, gabriel_pb2, client from rmexp.sche...
7,715
2,358
from .base import JsonRequest class PostRequest(JsonRequest): @staticmethod def rules(): return { 'email': 'required|email|unique:User,email', 'password': 'required|string|confirmed|least_string:6', 'username': 'required|alpha|least_string:3', 'role': 'i...
616
188
def kmp(P, T): # Compute the start position (number of chars) of the longest suffix that matches a prefix, # and store them into list K, the first element of K is set to be -1, the second # K = [] # K[t] store the value that when mismatch happens at t, should move Pattern P K[t] characters ahead t ...
1,650
532
# -*- coding: utf-8 -*- import os import json from os.path import dirname from argparse import ArgumentParser from clastic.render import AshesRenderFactory from common import DEBUG, DEBUG_LIST_ID, SENDKEY from web import (comma_int, ISSUE_TEMPLATES_PATH) from bake import (Issue, b...
1,657
572
import random import sys # usage: python3 words_gen.py > list.txt N = int(sys.argv[1]) # how many words should be in the resulting list with open("scripts/words.txt", "r") as f: words = f.readlines() for i in range(N): print(words[random.randint(0, 466550 - 1)].rstrip())
292
109
import unittest from modules.Input import * class CommandInputTest(unittest.TestCase): def setUp(self): self.field_a_locations = ["gOtOFieldAroW8", " go to fieLDA RoW 18 ", "gOTOfield A rOW88"] self.field_b_locations = ["gOtOFie...
3,037
1,123
#!/usr/bin/env python3 ############################################################################### # # # RMG - Reaction Mechanism Generator # # ...
14,601
5,560
""" ----------------------------------------------------------------------------- This source file is part of VPET - Virtual Production Editing Tools http://vpet.research.animationsinstitut.de/ http://github.com/FilmakademieRnd/VPET Copyright (c) 2021 Filmakademie Baden-Wuerttemberg, Animationsinstitut R&D Lab This p...
3,230
939
# Unlike the other datasets, CIFAR-10 uses ResNet and suffers from # a variety of problems, including exploding gradients import torch import torch.nn as nn from tqdm.notebook import tnrange, tqdm # For loading model sanely import os.path import sys # This here actually adds the path sys.path.append("../../") import ...
3,453
1,024
#!/usr/bin/env python3 # coding=utf-8 import copy from pathlib import Path from typing import ( Any, Generator, Iterable, List, MutableMapping, Optional, ) import toml from romt import error def target_matches_any(target: str, expected_targets: Iterable[str]) -> bool: if target == "*": ...
4,510
1,404
from googlevoice import Voice voice = Voice() voice.login() for message in voice.sms().messages: #if not message.isRead: print(message.id, message.phoneNumber, message.messageText) #message.mark(1)
212
69
# coding: utf-8 from tornado.web import RequestHandler from libra.handlers.base import authenticated class UserHandler(RequestHandler): @authenticated def post(self, user, **kwargs): self.write({"msg": "Success"})
233
70
import click from plextraktsync.commands.login import ensure_login from plextraktsync.factory import factory from plextraktsync.walker import WalkConfig, Walker def unmatched(no_progress_bar: bool, local: bool): config = factory.run_config().update(progressbar=not no_progress_bar) ensure_login() plex = f...
1,327
429
import os import numpy as np from montepython.likelihood_class import Likelihood import montepython.io_mp as io_mp import warnings import ccl_tools as tools import pyccl as ccl class covfefe(Likelihood): # initialization routine def __init__(self, path, data, command_line): Likelihood.__init__(sel...
1,940
734
from eth_utils import ( to_bytes, ) from eth_utils.toolz import ( identity, ) import pytest from web3._utils.module_testing.emitter_contract import ( CONTRACT_EMITTER_ABI, CONTRACT_EMITTER_CODE, ) from web3._utils.module_testing.math_contract import ( MATH_ABI, MATH_BYTECODE, ) from web3._utils....
1,156
433
from __future__ import division import itertools import json import math import os import random import shutil import subprocess import sys durationA = str(5) durationB = str(4) durationC = str(1) def main(): if len(sys.argv) > 1: nbDepth = int(sys.argv[1]) if nbDepth < 2 : nbDept...
5,068
1,901
### # Copyright 2015-2020, Institute for Systems Biology # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
24,120
8,235
# Created by yingwen at 2019-03-16 from multiprocessing import Process from malib.agents.agent_factory import * from malib.environments import DifferentialGame from malib.logger.utils import set_logger from malib.samplers.sampler import MASampler from malib.trainers import MATrainer from malib.utils.random import set_...
4,065
1,360
import decimal from django import template register = template.Library() @register.simple_tag def can_change_status(payment_request, user): return payment_request.can_user_change_status(user) @register.simple_tag def can_delete(payment_request, user): return payment_request.can_user_delete(user) @regist...
776
245
""" pylabnet measurement and service classes for Swabian Instruments TimeTagger which implements qudi's SlowCounter interface. This file contains pylabnet wrapper and service classes to allow qudi to access Swabian Instruments TT through pylabnet network as SlowCounter. Steps: - instantiate TimeTagger - instantiate p...
15,870
4,085
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Must still be recoded with some cleaner code. """ # imports. from dev0s.classes.config import * from dev0s.classes import utils from dev0s.classes.defaults.color import color, symbol from dev0s.classes import console from dev0s.classes.defaults.exceptions import Excep...
174,167
70,045
import pygame from pygame.locals import * from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * def main(): pygame.init() glutInit() display = (800,600) pygame.display.set_mode(display, DOUBLEBUF|OPENGL) gluPerspective(45, (display[0]/display[1]), 0.1, 50.0) glTranslatef(0.0, 0.0, -5) w...
619
313
# Copyright 2019 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
2,794
890
#!/usr/bin/env python import roslib; roslib.load_manifest('smach_ros') import rospy import rostest import unittest from actionlib import * from actionlib.msg import * from smach import * from smach_ros import * from smach_msgs.msg import * # Static goals g1 = TestGoal(1) # This goal should succeed g2 = TestGoal(2...
4,044
1,256
from django.db import models # Create your models here. ########################################################################## #投票 class Vote(models.Model): data=models.CharField(max_length=255) ##########################################################################
279
63
import argparse import torch def get_args(): parser = argparse.ArgumentParser(description='RL') parser.add_argument('--algo', default='a2c', help='algorithm to use: a2c | ppo ') parser.add_argument('--lr', type=float, default=7e-5, help='learning rate (defau...
3,016
904
from .backbone_nas import * from .adelaide_ea import * from .sr_ea import * from .esr_ea import * from .darts_cnn import * from .cars import * from .fis import * from .auto_lane import * from .mfkd import *
207
78
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 9 12:27:15 2021 @author: kuba """ import copy import numpy as np w = {"H0": {"H0":0.2,"H1": 0.2, "P0": 0.5, "P1": 0.1}, "H1": {"H0":0.2,"H1": 0.2, "P0": 0.1, "P1": 0.5}, "P0": {"H0":0.3,"H1": 0.3, "P0": 0.2, "P1": 0.2}, "P1": {"H0...
10,221
3,149
# course: ICS3U1 2019 # exercise: Culminating Activity # date: 2019-12-06 # student number: 340926187 # name: Brandon Ly # description: Two players (Mr Chun & Mr Pileggi) running around the school # collecting food for the food drive. # sprite classes import pygame...
15,467
4,601
from typing import Optional, List from pydantic import BaseModel class UsageLog(BaseModel): api_key: str is_active: bool never_expire: bool expiration_date: str latest_query_date: Optional[str] total_queries: int class UsageLogs(BaseModel): logs: List[UsageLog]
294
98
from abc import ABCMeta, abstractmethod from collections import OrderedDict from math import inf from typing import Iterator, Any, List, Dict, Type, Optional EPSILON = 1e-4 class Error(Exception): pass class ConstraintError(Error): pass class Constraint(metaclass=ABCMeta): @abstractmethod def isv...
10,811
3,298
input = """154, 159 172, 84 235, 204 181, 122 161, 337 305, 104 128, 298 176, 328 146, 71 210, 87 341, 195 50, 96 225, 151 86, 171 239, 68 79, 50 191, 284 200, 122 282, 240 224, 282 327, 74 158, 289 331, 244 154, 327 317, 110 272, 179 173, 175 187, 104 44, 194 202, 332 249, 197 244, 225 52, 127 299, 198 123, 198 349, 7...
2,789
1,270
import os from Backupy import Backupy def test_backup(): backup = Backupy() backup.add_directory('./') backup.start() assert os.path.exists(backup.filename) os.remove(backup.filename)
207
72
#!/usr/bin/python # -*- coding: utf-8 -*- # import logging logger = logging.getLogger(__name__) import multiprocessing as mp import tweetf0rm.handler from tweetf0rm.redis_helper import CrawlerQueue #MAX_QUEUE_SIZE = 32767 class CrawlerProcess(mp.Process): def __init__(self, node_id, crawler_id, redis_config, ha...
1,100
454
# Copyright (c) 2018 Cloudify Platform 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
6,500
2,154
# Copyright 2010 New Relic, Inc. # # 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 writ...
4,038
1,289
from spydrnet.ir import Port, Instance, InnerPin from spydrnet_tmr.transformation.util import add_suffix_to_name IN = Port.Direction.IN OUT = Port.Direction.OUT INOUT = Port.Direction.INOUT def apply_nmr(ports_and_instances_to_replicate, degree, name_suffix='NMR', rename_original=True): """ Replicate the sele...
14,767
4,125
import os import numpy as np import sys import logging LOG_PATH = os.environ['log'] spark_home = os.environ['SPARK_HOME'] sys.path.insert(0, os.path.join(spark_home, 'python')) sys.path.insert(0, os.path.join(spark_home, 'python/lib/py4j-0.10.4-src.zip')) from pyspark.sql import SparkSession spark = SparkSession.bui...
1,088
396
# Copyright 2016-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. from __future__ import absol...
1,436
463
class _FuncStorage: def __init__(self): self._function_map = {} def insert_function(self, name, function): self._function_map[name] = function def get_all_functions(self): return self._function_map
244
71
import openpnm as op import scipy as sp import pytest class SubdomainTest: def setup_class(self): ws = op.Workspace() ws.settings['local_data'] = True self.net = op.network.Cubic(shape=[3, 3, 3]) self.geo = op.geometry.GenericGeometry(network=self.net, ...
5,482
2,012
import pandas as pd from shapely.geometry import Point import geopandas as gpd import math import osmnx import requests from io import BytesIO from zipfile import ZipFile def read_poi_csv(input_file, col_id='id', col_name='name', col_lon='lon', col_lat='lat', col_kwds='kwds', col_sep=';', kwds_sep=',...
8,024
2,807
import re import random from collections import defaultdict import src.settings as var from src.utilities import * from src import debuglog, errlog, plog from src.decorators import cmd, event_listener from src.messages import messages from src.events import Event KILLS = {} # type: Dict[str, List[str]] @cmd("kill", ...
11,938
4,052
# -*- coding: utf-8 -*- """ Created on Fri Feb 28 13:52:20 2020 @author: midas """ import os import glob import pandas as pd import numpy as np all_filenames=['Data/Train.csv', 'Data/Test.csv'] combined_csv = pd.concat([pd.read_csv(f) for f in all_filenames ]) combined_csv.to_csv( "combined_csv...
2,878
1,220
""" Module for the jupyter extension """ import sys import datetime import os import contextlib from pprint import pprint from pathlib import Path from jupytext.contentsmanager import TextFileContentsManager from ploomber.sources.notebooksource import (_cleanup_rendered_nb, inject_cell) from ploomber.spec.dagspec imp...
12,388
3,322
#!/usr/bin/env python """ __author__ = Shannon T. Buckley, 10/8/16 Python 2.7.x """ import json import urllib2 import datetime import argparse VERSION = '0.2.1' def get_parser(): parser = argparse.ArgumentParser() parser.add_argument('-m', '--magnitude', action="store", type=float, ...
4,114
1,391
""" Tests to plot satellite data """ import os import plotly.graph_objects as go from nowcasting_dataset.data_sources.fake.batch import satellite_fake from nowcasting_dataset.geospatial import osgb_to_lat_lon from nowcasting_utils.visualization.data_sources.plot_satellite import ( make_animation_all_channels, ...
2,792
950
""" owtf.__main__ ~~~~~~~~~~~~~ A __main__ method for OWTF so that internal services can be called as Python modules. """ import sys from owtf.core import main if __name__ == "__main__": main()
200
65
from enum import IntEnum from typing import Type, TypeVar import logging T = TypeVar("T") class LogLevel(IntEnum): DEBUG = logging.DEBUG INFO = logging.INFO WARNING = logging.WARNING ERROR = logging.ERROR CRITICAL = logging.CRITICAL @classmethod def get(cls: Type[T], name: str) -> T: ...
1,823
572
# -*- coding: utf-8 -*- # json 형식 사용을 위한 임폴트 import json # get함수, 각각의 반복문을 통해 apialert_found안에 문자열 삽입후 리스트형식으로 정렬하여 리턴값 반환. def get(pe, strings_match): alerts = strings_match['apialert'] apialert_found = [] # pe에 DIRECTORY_ENTRY_IMPORT라는 변수가 있는지 확인하여 있으면 참 없으면 거짓. if hasattr(pe, 'DIRECTORY_ENTRY_IMPORT'):...
647
430
import shutil from pathlib import Path from tempfile import mkdtemp import pytest from click.testing import CliRunner import ape # NOTE: Ensure that we don't use local paths for these ape.config.DATA_FOLDER = Path(mkdtemp()).resolve() ape.config.PROJECT_FOLDER = Path(mkdtemp()).resolve() @pytest.fixture(scope="ses...
2,084
865
# # prime number generator # This program gets two number as input # and prints # Prime numbers in the range # Actual number of primes in the range # and Estimation based on formula # n # pi(n)= ------- # log(n) # pi(n)=number of primes less than n...
1,053
362
A=int(input("dame int")) B=int(input("dame int")) if(A>B): print("A es mayor") else: print("B es mayor")
118
51
#pylint: disable=logging-fstring-interpolation #Standart library imports import shutil import os import time from typing import Tuple from pathlib import Path import re from shutil import copyfile import wget # Local imports from selenium_driver_updater.util.logger import logger from selenium_driver_updater.util.excep...
11,520
3,319
# Copyright 2021, Yahoo # Licensed under the terms of the Apache 2.0 license. See the LICENSE file in the project root for terms from pathlib import Path from typing import Optional, Union from pydantic import BaseModel class ApplicationSettings(BaseModel): """ Defines the Global Settings that are consiste...
1,779
503
import logging from dvc.main import main from tests.basic_env import TestDvc from tests.func.test_repro import TestRepro from tests.func.test_repro import TestReproChangedDeepData class TestPipelineShowSingle(TestDvc): def setUp(self): super().setUp() self.stage = "foo.dvc" ret = main(["a...
6,656
2,420
import procgame.game from procgame.game import AdvancedMode import logging class ChaseLoop(procgame.game.AdvancedMode): """ Example of T2 "Chase Loop" functionality (described in the rules PDF on page J) TODO: Sound effects, other visual feedback?? """ def __init__(self, game): super(...
5,497
1,854
from django.contrib import admin from .models import Distribution admin.site.register(Distribution) # Register your models here.
130
32
# -*- coding: utf-8 -*- import logging; logging.basicConfig(level=logging.INFO) import numpy as np import matplotlib.pyplot as plt import logictensornetworks_wrapper as ltnw nr_samples=500 data=np.random.uniform([0,0],[1.,1.],(nr_samples,2)).astype(np.float32) data_A=data[np.where(np.sum(np.square(data-[.5,.5]),axi...
1,671
812
# !/usr/bin/env python3 # Author: C.K # Email: theck17@163.com # DateTime:2021-03-15 00:07:14 # Description: class Solution: def threeSum(self, nums: List[int]) -> List[List[int]]: result = set() for i in range(0, len(nums) - 1): # Reduce the problem to two sum(0) two_sum =...
837
261
from django.contrib.auth import authenticate, login from django.shortcuts import render, redirect from cart.models import Cart from django.views import View from .forms import LoginForm, RegistrationForm, CreateCompanyForm from customer.models import Customer, ShippingAddress from src.utils.mixins import CustomerMixin ...
2,937
765
from flask import Flask, render_template, request # from .recommendation import * # import pickle import pandas as pd import numpy as np # import keras # from keras.models import load_model import pickle def create_app(): # initializes our app APP = Flask(__name__) @APP.route('/') def form(): ...
1,771
546
from typing import List, Type from apiron.service.base import ServiceBase class DiscoverableService(ServiceBase): """ A Service whose hosts are determined via a host resolver. A host resolver is any class with a :func:`resolve` method that takes a service name as its sole argument and returns a l...
898
265
import math import os import re import shutil from plotman import job GB = 1_000_000_000 def df_b(d): 'Return free space for directory (in bytes)' usage = shutil.disk_usage(d) return usage.free def get_k32_plotsize(): return 108 * GB def is_valid_plot_dst(d, sched_cfg, all_jobs): if sched_cfg.s...
2,765
981
# (c) Copyright 2016 forkedbranch (http://forkedbranch.eu/) # Licensed under the Apache License, Version 2.0 import configparser config = configparser.ConfigParser() config.read('config.ini') def get_input_folder(): return config['DEFAULT']['InputFolder'] def get_output_folder(): return config['DEFAULT'...
608
208
# Copyright 2018, Michael DeHaan LLC # License: Apache License Version 2.0 # ------------------------------------------------------------------------- # registration.py - updates the database to say who is building something # and what the current settings are, which is used by the file serving # code to see if i...
4,091
1,240
# coding: utf-8 ''' Deformation codes are borrowed from MUDA McFee et al., A software framework for musical data augmentation, 2015 https://github.com/bmcfee/muda ''' import os import time import subprocess import tempfile import numpy as np import pandas as pd import datetime import tqdm import csv import fire import ...
12,957
4,488
from model.group import Group from model.contact import Contact def test_group_list(app,db): ui_group = app.group.get_groups_list() def clean(group): return Group(id=group.id, name=group.name.strip()) bd_group = map(clean,db.get_group_list()) assert sorted(ui_group,key=Group.id_or_max) == sorte...
742
261
""" Day 5: Normal Distribution I In certain plant, the time taken to assemble a car is a random variable, X having a normal distribution with a mean of 20 hours and a standard deviation of 2 hours. What is the probability that a car can be assembled at this plant in: 1. Less han 19.5 hours? 2. Between 20 and ...
1,065
415
for _ in range(int(input())): print(sum(map(int, input().split())))
68
26
import pytest from apostello import models @pytest.mark.slow @pytest.mark.django_db class TestContactForm: """Test the sending of SMS.""" def test_number_permissions_staff_exception(self, recipients, users): """Test sending a message now.""" calvin = recipients["calvin"] # check good...
4,325
1,374
bluelabs_format_hints = { 'field-delimiter': ',', 'record-terminator': "\n", 'compression': 'GZIP', 'quoting': None, 'quotechar': '"', 'doublequote': False, 'escape': '\\', 'encoding': 'UTF8', 'dateformat': 'YYYY-MM-DD', 'timeonlyformat': 'HH24:MI:SS', 'datetimeformattz': 'YY...
1,236
504
# FROM THE OP PAPER-ISH MINI_BATCH_SIZE = 32 MEMORY_SIZE = 10**6 BUFFER_SIZE = 100 LHIST = 4 GAMMA = 0.99 UPDATE_FREQ_ONlINE = 4 UPDATE_TARGET = 2500 # This was 10**4 but is measured in actor steps, so it's divided update_freq_online TEST_FREQ = 5*10**4 # Measure in updates TEST_STEPS = 10**4 LEARNING_RATE = 0.00025 G_...
1,829
925
import os import json import logging from collections import defaultdict import numpy as np import networkx as nx import torch from torch.utils.data import DataLoader from torch.optim import Adam from tqdm import tqdm from milieu.util.util import place_on_cpu, place_on_gpu from milieu.paper.methods.method import D...
6,031
1,694
import os import distutils.util from telegram import Update from telegram.ext import Updater, CommandHandler, Filters, CallbackContext from dotenv import load_dotenv from scripts.get_info import get_ratio from scripts.terra import get_balances, execute_swap load_dotenv(override=True) notify_telegram = bool(distutil...
5,185
1,666
import os import zipfile import requests def check_and_download(name, google_id, files=None, force_download=False): """ Checks if the meshes folder exists in the xml directory If not it will ask the user if they want to download them to be able to proceed Parameters ---------- name: string the file or direc...
3,179
1,212
import os import uuid from django.conf import settings from django.db import models from django.utils.translation import ugettext_lazy as _ def upload_avatar_to(instance, filename): filename, ext = os.path.splitext(filename) return os.path.join( 'avatar_images', 'avatar_{uuid}_{filename}{ext}...
2,188
646
__author__ = 'Chong-U Lim, culim@mit.edu' import uinput def Simulator(): def __init__(self): pass def test1(self): device = uinput.Device([uinput.KEY_E, uinput.KEY_H, uinput.KEY_L, uinput.KEY_O]) device.emit_click(uinput.KEY_H)
248
115
# Copyright 2015 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. """Top-level presubmit script for catapult. See https://www.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmi...
4,898
1,810
# author: jamie # email: jinjiedeng.jjd@gmail.com def Priority (c): if c == '&': return 3 elif c == '|': return 2 elif c == '^': return 1 elif c == '(': return 0 def InfixToPostfix (infix, postfix): stack = [] for c in infix: if c == '(': stack.append('(') elif c =...
1,454
500
from django.contrib import admin from .models import Target, Exercise, Workout # Register your models here. admin.site.register(Target) admin.site.register(Exercise) admin.site.register(Workout)
203
62
class Ciclo: def __init__(self): self.cicloNew = () self.respu = () self.a = () self.b = () self.c = () def nuevoCiclo(self): cicloNew = [] print(" ") print("Formulario de ingreso de ciclos") print("-----------------------------------") ...
1,015
324
import rumps import sys import icon_manager from datetime import timedelta import timekeeper import os # pyinstaller --onefile -w --add-data "Icons/:Icons" --icon="Icons/timeglass.png" --clean timeglass.spec # rumps.debug_mode(True) class TimerApp(rumps.App): def __init__(self, initial_seconds): super(Ti...
4,997
1,473
import os from discord.ext.commands import Bot from Flare import Flare bot = Bot("~~") bot.add_cog(Flare(bot)) @bot.command("ping") async def ping_pong(ctx): ctx.send("pong") bot.run(os.environ.get("BOT_TOKEN"))
223
93
import logging import os import sys import time project_name = os.getcwd().split('/')[-1] _logger = logging.getLogger(project_name) _logger.addHandler(logging.StreamHandler()) def _log_prefix(): # Returns (filename, line number) for the stack frame. def _get_file_line(): # pylint: disable=protected...
1,869
671
import setuptools ver = {} with open('OpenControl/_version.py') as fd: exec(fd.read(), ver) version = ver.get('__version__') with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setuptools.setup( name="OpenControl", version=version, author="VNOpenAI", author_e...
882
288
'''See the shared Google Drive documentation for an inheritance diagram that shows the relationships between the classes defined in this file. ''' import numpy as np import socket import time from riglib import source from ismore import settings, udp_feedback_client import ismore_bmi_lib from utils.constants import *...
65,264
23,714
#-*- coding: utf-8 -*- """ EOSS catalog system functionality for the catalog endpoint """ from utilities.web_utils import remote_file_exists __author__ = "Thilo Wehrmann, Steffen Gebhardt" __copyright__ = "Copyright 2016, EOSS GmbH" __credits__ = ["Thilo Wehrmann", "Steffen Gebhardt"] __license__ = "GPL" __version__...
22,089
6,614
import logging import pytest from ocs_ci.framework.testlib import tier1, skipif_ui_not_support, ui from ocs_ci.ocs.ui.pvc_ui import PvcUI from ocs_ci.framework.testlib import skipif_ocs_version from ocs_ci.framework.pytest_customization.marks import green_squad from ocs_ci.ocs.resources.pvc import get_all_pvc_objs, ge...
8,919
2,938
import pandas as pd from feature_generation.datasets.Timeseries import Timeseries from os.path import basename class CSCW(Timeseries): def __init__(self): super().__init__("cscw") self.column_name_mapping = { "id": self.column_names["subject_id"], "Fixation Start [ms]": sel...
1,955
586
from sys import exit from colour import * from rs.reaction_system import ReactionSystem class ReactionSystemWithConcentrations(ReactionSystem): def __init__(self): self.reactions = [] self.meta_reactions = dict() self.permanent_entities = dict() self.background_set = [] ...
16,103
4,834
import os import time import fire import torch import random import numpy as np import pandas as pd import torch.nn.functional as F ## to detach from monitor import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from trainer import Trainer from model import ConvNet1D from helpers imp...
9,241
3,431
import unittest from src.fetchers.hvdcLineCktOwnersFetcher import getOwnersForHvdcLineCktIds import datetime as dt from src.appConfig import getConfig class TestHvdcLineCktOwnersFetcher(unittest.TestCase): appConfig: dict = {} def setUp(self): self.appConfig = getConfig() def test_run(self) -> N...
730
255
# Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) from __future__ import print_function ''' >>> from iterator_ext import * >>> from input_iterator import * >>> x = list_int() >>> x.push_...
1,322
561
# -*- Python -*- # license # license. # ====================================================================== """Looks name up in the [geonames database](http://www.geonames.org/). [GeoNames Search Webservice API](http://www.geonames.org/export/geonames-search.html) """ import sys, os, urllib.request, json, time fro...
5,995
1,804
import subprocess import sys import django.conf import django.utils.encoding subprocess.Popen sys.argv plt.<caret>
117
39
# 271. Encode and Decode Strings ''' Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back to the original list of strings. Machine 1 (sender) has the function: string encode(vector<string> strs) { // ... your code return encoded_string; ...
2,921
950
from typing import Optional import xml.etree.ElementTree as ET from ...xml.XmlReader import XmlReader as XR from ..namespaces import API from ..namespaces import DATA from ...deserialization.create_enum import create_enum from ..dto.InvoiceNumberQuery import InvoiceNumberQuery from ..dto.InvoiceDirection import Invoice...
857
257
# Script to generate the necessary grammar rules for the # markov generator output type # Dataset: # http://www.drmaciver.com/2009/12/i-want-one-meelyun-sentences/ import re ALPHA = ' abcdefghijklmnopqrstuvwxyz' # read data from file with open('sentences', 'r', encoding="utf8") as f: content = f.read().splitlin...
1,614
626